rockerritesh commited on
Commit
00299f5
·
verified ·
1 Parent(s): e895c9a

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -1
main.py CHANGED
@@ -55,8 +55,11 @@ async def upload_image(fields:str, model:str, file: UploadFile = File(...)):
55
  response = json.loads(response)
56
 
57
  # Step 3: Convert fields and values into key-value pairs
 
 
58
  if 'fields' in response and 'values' in response:
59
- response = dict(zip(response['fields'], response['values']))
 
60
 
61
  # response flattening
62
  response = flatten(response)
 
55
  response = json.loads(response)
56
 
57
  # Step 3: Convert fields and values into key-value pairs
58
+ # if 'fields' in response and 'values' in response:
59
+ # response = dict(zip(response['fields'], response['values']))
60
  if 'fields' in response and 'values' in response:
61
+ response = {key: (None if value == "null" else value) for key, value in zip(response['fields'], response['values'])}
62
+
63
 
64
  # response flattening
65
  response = flatten(response)