Spaces:
Running
Running
set class var
Browse files
duckdb-nsql/eval/prompt_formatters.py
CHANGED
@@ -979,13 +979,10 @@ class DuckDBInstFormatterCustom(RajkumarFormatter):
|
|
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):
|
|
|
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):
|
evaluation_logic.py
CHANGED
@@ -101,10 +101,10 @@ def run_prediction(inference_api, model_name, prompt_format, custom_prompt, outp
|
|
101 |
try:
|
102 |
# Initialize necessary components
|
103 |
data_formatter = DefaultLoader()
|
104 |
-
print(f"DEBUG - Prompt format: {prompt_format}, Custom prompt content: {custom_prompt}")
|
105 |
if prompt_format.startswith("custom"):
|
106 |
-
|
107 |
-
|
|
|
108 |
else:
|
109 |
prompt_formatter = PROMPT_FORMATTERS[prompt_format]()
|
110 |
|
|
|
101 |
try:
|
102 |
# Initialize necessary components
|
103 |
data_formatter = DefaultLoader()
|
|
|
104 |
if prompt_format.startswith("custom"):
|
105 |
+
prompt_formatter_cls = PROMPT_FORMATTERS["custom"]
|
106 |
+
prompt_formatter_cls.PROMPT_TEMPLATE = custom_prompt
|
107 |
+
prompt_formatter = prompt_formatter_cls()
|
108 |
else:
|
109 |
prompt_formatter = PROMPT_FORMATTERS[prompt_format]()
|
110 |
|