Spaces:
Runtime error
Runtime error
Mustehson commited on
Commit ·
e0b017d
1
Parent(s): ca86d9c
Corrected Name
Browse files
app.py
CHANGED
|
@@ -165,8 +165,8 @@ def format_data(text_query, sql_query, sql_result, visualization_type):
|
|
| 165 |
results=sql_result, instructions=instruction)
|
| 166 |
print(prompt)
|
| 167 |
formatted_data = run_llm(prompt)
|
| 168 |
-
formatted_data = formatted_data.
|
| 169 |
-
formatted_data = formatted_data.
|
| 170 |
print(f'Formatted Data {formatted_data}')
|
| 171 |
return json.loads(formatted_data.replace('.', '').strip())
|
| 172 |
|
|
@@ -244,7 +244,6 @@ def main(table, text_query):
|
|
| 244 |
return generate_output(schema, prompt, generated_sql_query,
|
| 245 |
fig, sql_query_df)
|
| 246 |
|
| 247 |
-
|
| 248 |
if visualization_type != 'none':
|
| 249 |
try:
|
| 250 |
plot = visualize_result(text_query=text_query, sql_query=generated_sql_query,
|
|
|
|
| 165 |
results=sql_result, instructions=instruction)
|
| 166 |
print(prompt)
|
| 167 |
formatted_data = run_llm(prompt)
|
| 168 |
+
formatted_data = formatted_data.replace('```', '')
|
| 169 |
+
formatted_data = formatted_data.replace('json', '')
|
| 170 |
print(f'Formatted Data {formatted_data}')
|
| 171 |
return json.loads(formatted_data.replace('.', '').strip())
|
| 172 |
|
|
|
|
| 244 |
return generate_output(schema, prompt, generated_sql_query,
|
| 245 |
fig, sql_query_df)
|
| 246 |
|
|
|
|
| 247 |
if visualization_type != 'none':
|
| 248 |
try:
|
| 249 |
plot = visualize_result(text_query=text_query, sql_query=generated_sql_query,
|