monra commited on
Commit
4fb386b
1 Parent(s): 05d389e

Fix: continue fetching response after error

Browse files
Files changed (1) hide show
  1. server/backend.py +2 -1
server/backend.py CHANGED
@@ -69,10 +69,11 @@ class Backend_Api:
69
  print(f"Error with proxy {random_proxy}: {e}")
70
  remove_proxy(random_proxy)
71
 
72
- if not self.use_auto_proxy:
73
  try:
74
  res = gpt3.Completion.create(prompt=conversation)
75
  response = res['text']
 
76
  except Exception as e:
77
  print(f"Error: {e}")
78
 
 
69
  print(f"Error with proxy {random_proxy}: {e}")
70
  remove_proxy(random_proxy)
71
 
72
+ while not self.use_auto_proxy:
73
  try:
74
  res = gpt3.Completion.create(prompt=conversation)
75
  response = res['text']
76
+ break
77
  except Exception as e:
78
  print(f"Error: {e}")
79