OuroborosM commited on
Commit
6a60cd9
·
1 Parent(s): 408e795

add new load

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py CHANGED
@@ -1752,6 +1752,28 @@ def UpdateChatbot(Running_history):
1752
  # ChatbotHistory = ChatbotHistory + [(None, timestr+'\n'+WelcomeStr)]
1753
  yield ChatbotHistory
1754
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1755
  global last_answer
1756
  last_answer = ""
1757
 
@@ -1921,6 +1943,7 @@ with gr.Blocks() as demo:
1921
  # voice_output.play(clear_voice, None, None)
1922
 
1923
  # demo.load(read_logs, None, logs, every=1)
 
1924
  demo.load(UpdateChatbot, chatbot, chatbot, every=5)
1925
  # load(UpdateChatbot, chatbot, chatbot, every=5)
1926
 
 
1752
  # ChatbotHistory = ChatbotHistory + [(None, timestr+'\n'+WelcomeStr)]
1753
  yield ChatbotHistory
1754
 
1755
+ def UpdateChatbot2(Running_history):
1756
+ global ChatbotHistory
1757
+ timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
1758
+ # Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
1759
+ # # yield Running_history
1760
+ WelcomeStr = """
1761
+ This is AI Assistant powered by MECH Core Team.
1762
+ It is connected remotely with GPT4. The following function is available for you.
1763
+ 1. Free Chat with AI assistant
1764
+ 2. Search Information and Engineering Data: Vector Database + Internet
1765
+ 3. Make specific task with tools:
1766
+ - Text to Sound
1767
+ - Sound to Text
1768
+ - Doc summary
1769
+ - Code interpret (Beta version)
1770
+ - Text to Image (forecast)
1771
+ """
1772
+ # # Running_history = Running_history + [(None, timestr+'\n'+WelcomeStr)]
1773
+ ChatbotHistory = ChatbotHistory + [(None, timestr+'\n'+WelcomeStr)]
1774
+ yield ChatbotHistory
1775
+
1776
+
1777
  global last_answer
1778
  last_answer = ""
1779
 
 
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