OuroborosM commited on
Commit
f2acce5
·
1 Parent(s): 6a60cd9
Files changed (1) hide show
  1. app.py +22 -4
app.py CHANGED
@@ -1732,7 +1732,7 @@ def Text2Sound_HMI():
1732
  # return None
1733
 
1734
  def UpdateChatbot(Running_history):
1735
- global ChatbotHistory
1736
  # timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
1737
  # # Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
1738
  # # yield Running_history
@@ -1750,7 +1750,7 @@ def UpdateChatbot(Running_history):
1750
  # """
1751
  # # Running_history = Running_history + [(None, timestr+'\n'+WelcomeStr)]
1752
  # ChatbotHistory = ChatbotHistory + [(None, timestr+'\n'+WelcomeStr)]
1753
- yield ChatbotHistory
1754
 
1755
  def UpdateChatbot2(Running_history):
1756
  global ChatbotHistory
@@ -1835,6 +1835,25 @@ with gr.Blocks() as demo:
1835
  # description= "v0.3: Powered by MECH Core Team",
1836
  # )
1837
  # main.textbox.submit(chathmi3, [main.textbox, main.chatbot], [main.textbox, main.chatbot])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1838
 
1839
  with gr.Column() as main2:
1840
  title = gr.Markdown("""# <center> STLA BABY - YOUR FRIENDLY GUIDE
@@ -1943,8 +1962,7 @@ with gr.Blocks() as demo:
1943
  # voice_output.play(clear_voice, None, None)
1944
 
1945
  # demo.load(read_logs, None, logs, every=1)
1946
- demo.load(UpdateChatbot2, chatbot, chatbot)
1947
- demo.load(UpdateChatbot, chatbot, chatbot, every=5)
1948
  # load(UpdateChatbot, chatbot, chatbot, every=5)
1949
 
1950
  # demo(api_name="Update_Chatbot")
 
1732
  # return None
1733
 
1734
  def UpdateChatbot(Running_history):
1735
+
1736
  # timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
1737
  # # Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
1738
  # # yield Running_history
 
1750
  # """
1751
  # # Running_history = Running_history + [(None, timestr+'\n'+WelcomeStr)]
1752
  # ChatbotHistory = ChatbotHistory + [(None, timestr+'\n'+WelcomeStr)]
1753
+ yield Running_history
1754
 
1755
  def UpdateChatbot2(Running_history):
1756
  global ChatbotHistory
 
1835
  # description= "v0.3: Powered by MECH Core Team",
1836
  # )
1837
  # main.textbox.submit(chathmi3, [main.textbox, main.chatbot], [main.textbox, main.chatbot])
1838
+ UserRecord = gr.State([])
1839
+
1840
+ timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
1841
+ # Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
1842
+ # # yield Running_history
1843
+ WelcomeStr = """
1844
+ This is AI Assistant powered by MECH Core Team.
1845
+ It is connected remotely with GPT4. The following function is available for you.
1846
+ 1. Free Chat with AI assistant
1847
+ 2. Search Information and Engineering Data: Vector Database + Internet
1848
+ 3. Make specific task with tools:
1849
+ - Text to Sound
1850
+ - Sound to Text
1851
+ - Doc summary
1852
+ - Code interpret (Beta version)
1853
+ - Text to Image (forecast)
1854
+ """
1855
+ # # Running_history = Running_history + [(None, timestr+'\n'+WelcomeStr)]
1856
+ UserRecord = UserRecord + [(None, timestr+'\n'+WelcomeStr)]
1857
 
1858
  with gr.Column() as main2:
1859
  title = gr.Markdown("""# <center> STLA BABY - YOUR FRIENDLY GUIDE
 
1962
  # voice_output.play(clear_voice, None, None)
1963
 
1964
  # demo.load(read_logs, None, logs, every=1)
1965
+ demo.load(UpdateChatbot, UserRecord, chatbot, every=5)
 
1966
  # load(UpdateChatbot, chatbot, chatbot, every=5)
1967
 
1968
  # demo(api_name="Update_Chatbot")