Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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="
|
6 |
-
st.title("
|
7 |
|
8 |
@st.cache()
|
9 |
def load_data():
|
10 |
-
ds = load_dataset("loubnabnl/
|
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
|
25 |
|
26 |
-
st.
|
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"])
|
|