Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ from huggingface_hub import HfApi
|
|
3 |
import duckdb
|
4 |
from datasets import load_dataset
|
5 |
import pandas as pd
|
|
|
6 |
|
7 |
custom_css="""
|
8 |
* { animation: gow 3s 1 forwards; } @keyframes gow { from { transform: scale(0.1); } to { transform: scale(1.0); } }
|
@@ -51,13 +52,13 @@ with gr.Blocks(head=head_js,css=custom_css) as iface:
|
|
51 |
with gr.Row():
|
52 |
dataset_selector = gr.CheckboxGroup([d.id for d in datasets], label="Multi-Select Datasets")
|
53 |
num_samples_input = gr.Number(value=10, label="Number of Samples to retrieve per Dataset")
|
54 |
-
build_button = gr.Button("Build Dataset")
|
55 |
|
56 |
out_way = gr.File()
|
57 |
output_display = gr.Dataframe(headers=["Dataset", "Sample"])
|
58 |
build_button.click(fn=build_dataset,inputs=[dataset_selector, num_samples_input],outputs=[output_display,out_way])
|
59 |
dataset_selector.change(preview,dataset_selector,frst_sample)
|
60 |
srchbx.change(looky,srchbx,dataset_selector)
|
61 |
-
iface.load(None,None,None,js="""() =>{var colr = 'rgba('+Math.floor(Math.random() * 256)+','+Math.floor(Math.random() * 256)+','+Math.floor(Math.random() * 256)+','+(Math.random() * 1)+')'; document.querySelectorAll('*').forEach(item =>{ item.style.backgroundColor=colr; }); var tin = document.getElementById('moish'); var parents=[]; function getAllParentNodes(element) {while (element.parentNode) {element = element.parentNode; element.style.background = bkd; parents.push(element); }; }; getAllParentNodes(tin);
|
62 |
|
63 |
iface.launch(debug=True)
|
|
|
3 |
import duckdb
|
4 |
from datasets import load_dataset
|
5 |
import pandas as pd
|
6 |
+
import os, time, sys, json, random
|
7 |
|
8 |
custom_css="""
|
9 |
* { animation: gow 3s 1 forwards; } @keyframes gow { from { transform: scale(0.1); } to { transform: scale(1.0); } }
|
|
|
52 |
with gr.Row():
|
53 |
dataset_selector = gr.CheckboxGroup([d.id for d in datasets], label="Multi-Select Datasets")
|
54 |
num_samples_input = gr.Number(value=10, label="Number of Samples to retrieve per Dataset")
|
55 |
+
build_button = gr.Button("Build Dataset", elem_id="moish")
|
56 |
|
57 |
out_way = gr.File()
|
58 |
output_display = gr.Dataframe(headers=["Dataset", "Sample"])
|
59 |
build_button.click(fn=build_dataset,inputs=[dataset_selector, num_samples_input],outputs=[output_display,out_way])
|
60 |
dataset_selector.change(preview,dataset_selector,frst_sample)
|
61 |
srchbx.change(looky,srchbx,dataset_selector)
|
62 |
+
iface.load(None,None,None,js="""() =>{var colr = 'rgba('+Math.floor(Math.random() * 256)+','+Math.floor(Math.random() * 256)+','+Math.floor(Math.random() * 256)+','+(Math.random() * 1)+')'; document.querySelectorAll('*').forEach(item =>{ item.style.backgroundColor=colr; }); var tin = document.getElementById('moish'); var parents=[]; function getAllParentNodes(element) {while (element.parentNode) {element = element.parentNode; element.style.background = bkd; parents.push(element); }; }; getAllParentNodes(tin);}""",)
|
63 |
|
64 |
iface.launch(debug=True)
|