YC-Chen commited on
Commit
2106be6
1 Parent(s): 6130bd5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -128,11 +128,13 @@ with gr.Blocks() as demo:
128
  "frequency_penalty": FREQUENCY_PENALTY,
129
  }
130
 
131
- outputs = requests.post(API_URL, headers=HEADERS, data=json.dumps(data)).json()['choices'][0]['text']
 
 
132
  if history[-1][1] is None:
133
- history[-1][1] = outputs
134
  else:
135
- history[-1][1] += outputs
136
  return history
137
 
138
  msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
 
128
  "frequency_penalty": FREQUENCY_PENALTY,
129
  }
130
 
131
+ outputs = requests.post(API_URL, headers=HEADERS, data=json.dumps(data)).json()
132
+ print(outputs)
133
+ response = outputs['choices'][0]['text']
134
  if history[-1][1] is None:
135
+ history[-1][1] = response
136
  else:
137
+ history[-1][1] += response
138
  return history
139
 
140
  msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(