rr19tech commited on
Commit
e701dda
·
verified ·
1 Parent(s): 7bb0247

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -33,12 +33,12 @@ def call_private_api(user_input):
33
 
34
  if response.status_code == 200:
35
  #return response.json()
36
- return response.text #doing this as a quick woraround
37
  else:
38
  return {"error": f"Status {response.status_code}", "detail": response.text}
39
  except Exception as e:
40
  return {"error": f"Connection failed: {str(e)}"}
41
 
42
  # Simple UI to test it
43
- demo = gr.Interface(fn=call_private_api, inputs="text", outputs="json")
44
- demo.queue().launch()
 
33
 
34
  if response.status_code == 200:
35
  #return response.json()
36
+ return response.text # workaround
37
  else:
38
  return {"error": f"Status {response.status_code}", "detail": response.text}
39
  except Exception as e:
40
  return {"error": f"Connection failed: {str(e)}"}
41
 
42
  # Simple UI to test it
43
+ demo = gr.Interface(fn=call_private_api, inputs="text", outputs="json").launch()
44
+ #demo.queue().launch()