Spaces:
Build error
Build error
Commit
·
aa23dc4
1
Parent(s):
607292d
fix: update json load workflow workflow
Browse files
app.py
CHANGED
|
@@ -33,14 +33,14 @@ def process_fields(fields):
|
|
| 33 |
def process_records_gradio(records, fields, question, example_records=None):
|
| 34 |
try:
|
| 35 |
# Convert string inputs to dictionaries
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
|
| 45 |
if not fields and not question:
|
| 46 |
raise Exception("Error: Either fields or question must be provided")
|
|
|
|
| 33 |
def process_records_gradio(records, fields, question, example_records=None):
|
| 34 |
try:
|
| 35 |
# Convert string inputs to dictionaries
|
| 36 |
+
if isinstance(records, str):
|
| 37 |
+
records = json.loads(records)
|
| 38 |
+
if isinstance(example_records, str):
|
| 39 |
+
example_records = json.loads(example_records)
|
| 40 |
+
if isinstance(fields, str):
|
| 41 |
+
fields = json.loads(fields)
|
| 42 |
+
if isinstance(question, str):
|
| 43 |
+
question = json.loads(question)
|
| 44 |
|
| 45 |
if not fields and not question:
|
| 46 |
raise Exception("Error: Either fields or question must be provided")
|