yuntian-deng commited on
Commit
60e8ed8
1 Parent(s): a57becc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -58,7 +58,7 @@ def predict(inputs, top_p, temperature, chat_counter, chatbot=[], history=[]):
58
  chat_counter+=1
59
 
60
  history.append(inputs)
61
- print(f"payload is - {payload}")
62
  # make a POST request to the API endpoint using the requests.post method, passing in stream=True
63
  response = requests.post(API_URL, headers=headers, json=payload, stream=True)
64
  print(f"response code - {response}")
@@ -87,7 +87,7 @@ def predict(inputs, top_p, temperature, chat_counter, chatbot=[], history=[]):
87
  chat = [(history[i], history[i + 1]) for i in range(0, len(history) - 1, 2) ] # convert to tuples of list
88
  token_counter+=1
89
  yield chat, history, chat_counter, response # resembles {chatbot: chat, state: history}
90
- print(partial_words)
91
 
92
 
93
  def reset_textbox():
 
58
  chat_counter+=1
59
 
60
  history.append(inputs)
61
+ #print(f"payload is - {payload}")
62
  # make a POST request to the API endpoint using the requests.post method, passing in stream=True
63
  response = requests.post(API_URL, headers=headers, json=payload, stream=True)
64
  print(f"response code - {response}")
 
87
  chat = [(history[i], history[i + 1]) for i in range(0, len(history) - 1, 2) ] # convert to tuples of list
88
  token_counter+=1
89
  yield chat, history, chat_counter, response # resembles {chatbot: chat, state: history}
90
+ print(json.dumps({"payload": payload, "partial_words": partial_words}))
91
 
92
 
93
  def reset_textbox():