tommy24 commited on
Commit
98ef4b4
·
1 Parent(s): eabc804

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -50,17 +50,20 @@ def main(prompt):
50
  }
51
 
52
  response = requests.post(url, json=payload, headers=headers)
53
- data = json.loads(response.text)
54
  try:
55
- data = data["message"]
56
  try:
57
- if "ChatSonic" in data:
58
- data = data.replace("ChatSonic","John")
 
 
 
 
59
  return data
60
  except:
61
- return data
62
  except:
63
- return "Error occured"
64
 
65
  iface = gr.Interface(fn=main, inputs="text", outputs="text")
66
  iface.launch()
 
50
  }
51
 
52
  response = requests.post(url, json=payload, headers=headers)
 
53
  try:
54
+ data = json.loads(response.text)
55
  try:
56
+ data = data["message"]
57
+ try:
58
+ if "ChatSonic" in data:
59
+ data = data.replace("ChatSonic","John")
60
+ return data
61
+ except:
62
  return data
63
  except:
64
+ return "Error occured!"
65
  except:
66
+ return "Error occured!"
67
 
68
  iface = gr.Interface(fn=main, inputs="text", outputs="text")
69
  iface.launch()