Spaces:
Build error
Build error
Update app.py
Browse files84 unmodified lines85868788888990916 unmodified lines989910010110110210310413 unmodified lines11811912012112112212312484 unmodified lines ### Question: {query_input}
### Response (use duckdb shorthand if possible) replace all table names with {first_parquet_url} in the generated sql query: ### Response (use duckdb shorthand if possible): """ try: sql_output = query_remote_model(text)6 unmodified lines }
# Should be replaced by the prompt but not working sql_output = sql_output.replace("data", f"'{first_parquet_url}'") sql_output = sql_output.replace("FROM data", f"FROM '{first_parquet_url}'") try: query_result = con.sql(sql_output).df() except Exception as error:13 unmodified lines gr.Markdown("This space showcase how to generate a SQL query from a text and get the result.") gr.Markdown("Tech stack: duckdb and DuckDB-NSQL-7B model") dataset_name = gr.Textbox("jamescalam/world-cities-geo", label="Dataset Name") query_input = gr.Textbox("Which cities are part of Albania country?", label="Ask something about your data") query_input = gr.Textbox("Cities from Albania country?", label="Ask something about your data") examples = [ ["Cities from Albania country"], ["The continent with the most number of countries"],app.py+3-3