Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import json | |
| from datasets import load_dataset | |
| st.set_page_config(page_title="Kaggle Notebooks (as scripts) visualization", layout="wide") | |
| st.title("Kaggle Notebooks (as scripts) visualization") | |
| def load_data(): | |
| ds = load_dataset("loubnabnl/kaggle-scripts-subset", split="train") | |
| return ds | |
| samples = load_data() | |
| col1, _ = st.columns([2, 4]) | |
| with col1: | |
| 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) | |
| st.code(samples[index_example]["script"]) |