pratyushmaini commited on
Commit
b1029e7
1 Parent(s): 62f34bc
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from datasets import load_dataset
3
+
4
+ def view_dataset(sample_size):
5
+ dataset = load_dataset("locuslab/TOFU")
6
+ data = dataset['train'].select(range(sample_size)).to_pandas()
7
+ return data
8
+
9
+ interface = gr.Interface(
10
+ fn=view_dataset,
11
+ inputs=gr.inputs.Slider(minimum=1, maximum=100, step=1, default=5, label="Number of Samples"),
12
+ outputs="dataframe",
13
+ title="TOFU Dataset Viewer",
14
+ description="Interactive viewer for the TOFU dataset"
15
+ )
16
+
17
+ if __name__ == "__main__":
18
+ interface.launch()