Reverted parallelism workaround
Browse files
app.py
CHANGED
@@ -820,7 +820,7 @@ def get_reply(response, username = None, histories = {}, in_stepsize = 2.56, in_
|
|
820 |
num_iterations = int(in_num_iterations)
|
821 |
top_k = int(in_top_k)
|
822 |
if response.endswith(("bye", "Bye", "bye.", "Bye.", "bye!", "Bye!")):
|
823 |
-
|
824 |
return "<div class='chatbot'>Chatbot restarted</div>", histories
|
825 |
history = histories.get(username, None)
|
826 |
convo_hist = (history if history != None else "How are you?<|endoftext|>") + response + eot_token
|
@@ -877,7 +877,7 @@ def get_reply(response, username = None, histories = {}, in_stepsize = 2.56, in_
|
|
877 |
convo_hist = eot_token.join(convo_hist_split)
|
878 |
|
879 |
except:
|
880 |
-
|
881 |
return "<div class='chatbot'>Error occured, chatbot restarted</div>", histories
|
882 |
histories[username] = convo_hist
|
883 |
return html, histories
|
|
|
820 |
num_iterations = int(in_num_iterations)
|
821 |
top_k = int(in_top_k)
|
822 |
if response.endswith(("bye", "Bye", "bye.", "Bye.", "bye!", "Bye!")):
|
823 |
+
histories[username] = None
|
824 |
return "<div class='chatbot'>Chatbot restarted</div>", histories
|
825 |
history = histories.get(username, None)
|
826 |
convo_hist = (history if history != None else "How are you?<|endoftext|>") + response + eot_token
|
|
|
877 |
convo_hist = eot_token.join(convo_hist_split)
|
878 |
|
879 |
except:
|
880 |
+
histories[username] = None
|
881 |
return "<div class='chatbot'>Error occured, chatbot restarted</div>", histories
|
882 |
histories[username] = convo_hist
|
883 |
return html, histories
|