Spaces:
Sleeping
Sleeping
import gradio as gr | |
from gradio_huggingfacehub_search import HuggingfaceHubSearch | |
with gr.Blocks() as demo: | |
gr.Markdown("# π« Preview dataset π«") | |
dataset_name = HuggingfaceHubSearch( | |
label="Hub Dataset ID", | |
placeholder="Search for dataset id on Huggingface", | |
search_type="dataset", | |
value="HuggingFaceFW/fineweb", | |
) | |
def embed(name): | |
html_code = f""" | |
<iframe | |
src="https://huggingface.co/datasets/{name}/embed/viewer/default/train" | |
frameborder="0" | |
width="100%" | |
height="700px" | |
></iframe> | |
""" | |
return gr.HTML(value=html_code) | |
demo.launch() |