Spaces:
Sleeping
Sleeping
handle output properly
Browse files
app.py
CHANGED
|
@@ -2,15 +2,18 @@ import gradio as gr
|
|
| 2 |
from evaluation_logic import run_evaluation, AVAILABLE_PROMPT_FORMATS
|
| 3 |
|
| 4 |
def gradio_run_evaluation(model_name, prompt_format):
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
with gr.Blocks() as demo:
|
| 8 |
gr.Markdown("# DuckDB SQL Evaluation App")
|
| 9 |
|
| 10 |
model_name = gr.Textbox(label="Model Name (e.g., qwen/qwen-2.5-72b-instruct)")
|
| 11 |
prompt_format = gr.Dropdown(
|
| 12 |
-
label="Prompt Format",
|
| 13 |
-
choices=AVAILABLE_PROMPT_FORMATS,
|
| 14 |
value="duckdbinstgraniteshort"
|
| 15 |
)
|
| 16 |
start_btn = gr.Button("Start Evaluation")
|
|
|
|
| 2 |
from evaluation_logic import run_evaluation, AVAILABLE_PROMPT_FORMATS
|
| 3 |
|
| 4 |
def gradio_run_evaluation(model_name, prompt_format):
|
| 5 |
+
output = []
|
| 6 |
+
for result in run_evaluation(model_name, prompt_format):
|
| 7 |
+
output.append(result)
|
| 8 |
+
yield "\n".join(output)
|
| 9 |
|
| 10 |
with gr.Blocks() as demo:
|
| 11 |
gr.Markdown("# DuckDB SQL Evaluation App")
|
| 12 |
|
| 13 |
model_name = gr.Textbox(label="Model Name (e.g., qwen/qwen-2.5-72b-instruct)")
|
| 14 |
prompt_format = gr.Dropdown(
|
| 15 |
+
label="Prompt Format",
|
| 16 |
+
choices=AVAILABLE_PROMPT_FORMATS,
|
| 17 |
value="duckdbinstgraniteshort"
|
| 18 |
)
|
| 19 |
start_btn = gr.Button("Start Evaluation")
|