loubnabnl HF staff commited on
Commit
89247af
·
1 Parent(s): 613c491

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -14
app.py CHANGED
@@ -2,26 +2,17 @@ import streamlit as st
2
  import json
3
  from datasets import load_dataset
4
 
5
- st.set_page_config(page_title="Large GitHub Issues", layout="wide")
6
- st.title("Issues with large text")
7
 
8
  @st.cache()
9
  def load_data():
10
- ds = load_dataset("loubnabnl/large-text-issues", split="train")
11
  return ds
12
 
13
- def print_issue(events):
14
- for event in events:
15
- st.markdown("""---""")
16
- masked_author = f"masked as {event['masked_author']}" if "masked_author" in event else ""
17
- st.markdown(f"**Author:** {event['author']} {masked_author}, {event['action']} {event['type']} with title: {event['title']}.\
18
- Text size is: **{event['size']}** and Number of lines is: **{event['nb_lines']}**")
19
- st.code(f"{event['text']}", language="none")
20
-
21
  samples = load_data()
22
  col1, _ = st.columns([2, 4])
23
  with col1:
24
- index_example = st.number_input(f"Index of the chosen conversation from the existing {len(samples)}", min_value=0, max_value=len(samples)-1, value=0, step=1)
25
 
26
- st.write(f"Issue size: {samples[index_example]['text_size_no_bots']}\n\n")
27
- print_issue(samples[index_example]["events"])
 
2
  import json
3
  from datasets import load_dataset
4
 
5
+ st.set_page_config(page_title="Kaggle Notebooks (as scripts) visualization", layout="wide")
6
+ st.title("Kaggle Notebooks (as scripts) visualization")
7
 
8
  @st.cache()
9
  def load_data():
10
+ ds = load_dataset("loubnabnl/kaggle-scripts", split="train")
11
  return ds
12
 
 
 
 
 
 
 
 
 
13
  samples = load_data()
14
  col1, _ = st.columns([2, 4])
15
  with col1:
16
+ index_example = st.number_input(f"Index of the chosen sample from the existing {len(samples)}", min_value=0, max_value=len(samples)-1, value=0, step=1)
17
 
18
+ st.code(samples[index_example]["script"])