Spaces:
Sleeping
Sleeping
Commit
·
d3ef38f
1
Parent(s):
2321bd0
chore: add new parameters for the prediction in app.py
Browse files
app.py
CHANGED
@@ -728,13 +728,22 @@ with gr.Blocks(theme='shivi/calm_seafoam', css_paths='style.css', js=js_func) as
|
|
728 |
db_id = input_data["db_name"],
|
729 |
base_path = input_data["data_path"],
|
730 |
normalize=False,
|
731 |
-
sql=row["query"]
|
|
|
732 |
)
|
733 |
|
734 |
-
prompt_to_send = us.prepare_prompt(input_data["prompt"], question, schema_text, samples)
|
|
|
735 |
#PREDICTION SQL
|
736 |
|
737 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
738 |
prediction = response['response_parsed']
|
739 |
price = response['cost']
|
740 |
answer = response['response']
|
|
|
728 |
db_id = input_data["db_name"],
|
729 |
base_path = input_data["data_path"],
|
730 |
normalize=False,
|
731 |
+
sql=row["query"],
|
732 |
+
get_insert_into=True
|
733 |
)
|
734 |
|
735 |
+
#prompt_to_send = us.prepare_prompt(input_data["prompt"], question, schema_text, samples)
|
736 |
+
prompt_to_send = input_data["prompt"]
|
737 |
#PREDICTION SQL
|
738 |
|
739 |
+
# TODO add button for QA or SP and pass to .make_prediction parameter TASK
|
740 |
+
response = predictor.make_prediction(
|
741 |
+
question=question,
|
742 |
+
db_schema=schema_text,
|
743 |
+
model_name=model,
|
744 |
+
prompt=f"{prompt_to_send}",
|
745 |
+
task="SP" # TODO change accordingly
|
746 |
+
)
|
747 |
prediction = response['response_parsed']
|
748 |
price = response['cost']
|
749 |
answer = response['response']
|