akiko19191 commited on
Commit
d72922a
·
verified ·
1 Parent(s): 03633ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -20,6 +20,7 @@ app.config['UPLOAD_FOLDER'] = "static"
20
  @app.route("/chat/completions", methods=['POST'])
21
  @app.route("/", methods=['POST'])
22
  def chat_completions2():
 
23
  streaming = req.json.get('stream', False)
24
  model = req.json.get('model', 'gpt-4-turbo')
25
  messages = req.json.get('messages')
@@ -36,6 +37,8 @@ def chat_completions2():
36
 
37
  def stream_response(messages,model,api_keys="",functions=[],tools=[]):
38
  helper.q = queue.Queue() # create a queue to store the response lines
 
 
39
 
40
 
41
 
 
20
  @app.route("/chat/completions", methods=['POST'])
21
  @app.route("/", methods=['POST'])
22
  def chat_completions2():
23
+ helper.stopped=True
24
  streaming = req.json.get('stream', False)
25
  model = req.json.get('model', 'gpt-4-turbo')
26
  messages = req.json.get('messages')
 
37
 
38
  def stream_response(messages,model,api_keys="",functions=[],tools=[]):
39
  helper.q = queue.Queue() # create a queue to store the response lines
40
+ if helper.stopped:
41
+ helper.stopped=False
42
 
43
 
44