RayBe commited on
Commit
05a02ba
·
verified ·
1 Parent(s): ded2ee6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- 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
 
 
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