Spaces:
Runtime error
Runtime error
Commit
·
2b853f2
1
Parent(s):
02ded21
restart load refresh
Browse files
app.py
CHANGED
|
@@ -97,6 +97,10 @@ import regex
|
|
| 97 |
global CurrentAgent
|
| 98 |
CurrentAgent = os.environ["agent_type"]
|
| 99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
class CodeBlock:
|
| 101 |
'''
|
| 102 |
CodeBlock Class which is able to run in Code Runner
|
|
@@ -1710,6 +1714,7 @@ def Text2Sound_HMI():
|
|
| 1710 |
# return None
|
| 1711 |
|
| 1712 |
def UpdateChatbot(Running_history):
|
|
|
|
| 1713 |
timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
|
| 1714 |
# Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
|
| 1715 |
# yield Running_history
|
|
@@ -1725,8 +1730,9 @@ def UpdateChatbot(Running_history):
|
|
| 1725 |
- Code interpret (Beta version)
|
| 1726 |
- Text to Image (forecast)
|
| 1727 |
"""
|
| 1728 |
-
Running_history = Running_history + [(None, timestr+'\n'+WelcomeStr)]
|
| 1729 |
-
|
|
|
|
| 1730 |
|
| 1731 |
global last_answer
|
| 1732 |
last_answer = ""
|
|
@@ -1897,7 +1903,7 @@ with gr.Blocks() as demo:
|
|
| 1897 |
# voice_output.play(clear_voice, None, None)
|
| 1898 |
|
| 1899 |
# demo.load(read_logs, None, logs, every=1)
|
| 1900 |
-
demo.load(UpdateChatbot, chatbot, chatbot,
|
| 1901 |
# load(UpdateChatbot, chatbot, chatbot, every=5)
|
| 1902 |
|
| 1903 |
# demo(api_name="Update_Chatbot")
|
|
|
|
| 97 |
global CurrentAgent
|
| 98 |
CurrentAgent = os.environ["agent_type"]
|
| 99 |
|
| 100 |
+
global ChatbotHistory
|
| 101 |
+
ChatbotHistory = []
|
| 102 |
+
|
| 103 |
+
|
| 104 |
class CodeBlock:
|
| 105 |
'''
|
| 106 |
CodeBlock Class which is able to run in Code Runner
|
|
|
|
| 1714 |
# return None
|
| 1715 |
|
| 1716 |
def UpdateChatbot(Running_history):
|
| 1717 |
+
global ChatbotHistory
|
| 1718 |
timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
|
| 1719 |
# Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
|
| 1720 |
# yield Running_history
|
|
|
|
| 1730 |
- Code interpret (Beta version)
|
| 1731 |
- Text to Image (forecast)
|
| 1732 |
"""
|
| 1733 |
+
# Running_history = Running_history + [(None, timestr+'\n'+WelcomeStr)]
|
| 1734 |
+
ChatbotHistory = ChatbotHistory + [(None, timestr+'\n'+WelcomeStr)]
|
| 1735 |
+
yield ChatbotHistory
|
| 1736 |
|
| 1737 |
global last_answer
|
| 1738 |
last_answer = ""
|
|
|
|
| 1903 |
# voice_output.play(clear_voice, None, None)
|
| 1904 |
|
| 1905 |
# demo.load(read_logs, None, logs, every=1)
|
| 1906 |
+
demo.load(UpdateChatbot, chatbot, chatbot, every=5)
|
| 1907 |
# load(UpdateChatbot, chatbot, chatbot, every=5)
|
| 1908 |
|
| 1909 |
# demo(api_name="Update_Chatbot")
|