Spaces:
Running
Running
debug output
Browse files- app.py +2 -0
- duckdb-nsql/eval/prompt_formatters.py +3 -0
app.py
CHANGED
@@ -9,6 +9,8 @@ PROMPT_TEMPLATES = {
|
|
9 |
}
|
10 |
|
11 |
def gradio_run_evaluation(inference_api, model_name, prompt_format, openrouter_token=None, custom_prompt=None):
|
|
|
|
|
12 |
# Set environment variable if OpenRouter token is provided
|
13 |
if inference_api == "openrouter":
|
14 |
os.environ["OPENROUTER_API_KEY"] = str(openrouter_token)
|
|
|
9 |
}
|
10 |
|
11 |
def gradio_run_evaluation(inference_api, model_name, prompt_format, openrouter_token=None, custom_prompt=None):
|
12 |
+
print(f"DEBUG - Prompt format: {prompt_format}, Custom prompt content: {custom_prompt}")
|
13 |
+
|
14 |
# Set environment variable if OpenRouter token is provided
|
15 |
if inference_api == "openrouter":
|
16 |
os.environ["OPENROUTER_API_KEY"] = str(openrouter_token)
|
duckdb-nsql/eval/prompt_formatters.py
CHANGED
@@ -979,10 +979,13 @@ class DuckDBInstFormatterCustom(RajkumarFormatter):
|
|
979 |
context_text: str,
|
980 |
) -> str | list[str]:
|
981 |
"""Get prompt format."""
|
|
|
|
|
982 |
instruction = cls.PROMPT_TEMPLATE.format(
|
983 |
schema=table_text,
|
984 |
question=instruction
|
985 |
)
|
|
|
986 |
return instruction
|
987 |
|
988 |
class DuckDBInstNoShorthandFormatter(DuckDBInstFormatter):
|
|
|
979 |
context_text: str,
|
980 |
) -> str | list[str]:
|
981 |
"""Get prompt format."""
|
982 |
+
print(f"DEBUG - template: {cls.PROMPT_TEMPLATE}")
|
983 |
+
|
984 |
instruction = cls.PROMPT_TEMPLATE.format(
|
985 |
schema=table_text,
|
986 |
question=instruction
|
987 |
)
|
988 |
+
print(f"DEBUG - instruction: {instruction}")
|
989 |
return instruction
|
990 |
|
991 |
class DuckDBInstNoShorthandFormatter(DuckDBInstFormatter):
|