Spaces:
Runtime error
Runtime error
add duckdb call
Browse files- app.py +9 -3
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,7 +1,13 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
demo.launch()
|
|
|
1 |
+
import duckdb
|
2 |
import gradio as gr
|
3 |
|
4 |
+
con = duckdb.connect(":memory:")
|
|
|
5 |
|
6 |
+
def greet(SQL_Query):
|
7 |
+
return con.sql(SQL_Query).df()
|
8 |
+
|
9 |
+
examples = [
|
10 |
+
"SELECT dump, avg(token_count) FROM 'hf://datasets/HuggingFaceFW/fineweb/sample/10BT/*.parquet' GROUP BY dump;",
|
11 |
+
]
|
12 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="dataframe", examples=examples)
|
13 |
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
duckdb==0.10.3
|