fineweb-edu-sql / app.py
lhoestq's picture
lhoestq HF staff
add duckdb call
c796372
raw
history blame
358 Bytes
import duckdb
import gradio as gr
con = duckdb.connect(":memory:")
def greet(SQL_Query):
return con.sql(SQL_Query).df()
examples = [
"SELECT dump, avg(token_count) FROM 'hf://datasets/HuggingFaceFW/fineweb/sample/10BT/*.parquet' GROUP BY dump;",
]
demo = gr.Interface(fn=greet, inputs="text", outputs="dataframe", examples=examples)
demo.launch()