Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,11 +25,11 @@ def merge_json_with_amount(model_output, amount):
|
|
| 25 |
except json.JSONDecodeError:
|
| 26 |
return model_output # Return raw model output if it's not valid JSON
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
|
| 34 |
return json.dumps(data, ensure_ascii=False)
|
| 35 |
|
|
|
|
| 25 |
except json.JSONDecodeError:
|
| 26 |
return model_output # Return raw model output if it's not valid JSON
|
| 27 |
|
| 28 |
+
# if amount:
|
| 29 |
+
# try:
|
| 30 |
+
# data["amount"] = float(amount) # Convert to float
|
| 31 |
+
# except ValueError:
|
| 32 |
+
# data["amount"] = amount # Keep as string if conversion fails
|
| 33 |
|
| 34 |
return json.dumps(data, ensure_ascii=False)
|
| 35 |
|