OuroborosM commited on
Commit
3dba961
·
1 Parent(s): 25a6d74

update history

Browse files
Files changed (1) hide show
  1. app.py +19 -18
app.py CHANGED
@@ -1732,25 +1732,26 @@ def Text2Sound_HMI():
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
1739
- # WelcomeStr = """
1740
- # This is AI Assistant powered by MECH Core Team.
1741
- # It is connected remotely with GPT4. The following function is available for you.
1742
- # 1. Free Chat with AI assistant
1743
- # 2. Search Information and Engineering Data: Vector Database + Internet
1744
- # 3. Make specific task with tools:
1745
- # - Text to Sound
1746
- # - Sound to Text
1747
- # - Doc summary
1748
- # - Code interpret (Beta version)
1749
- # - Text to Image (forecast)
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
@@ -1854,7 +1855,7 @@ with gr.Blocks() as demo:
1854
  """
1855
  # # Running_history = Running_history + [(None, timestr+'\n'+WelcomeStr)]
1856
  # UserRecord = UserRecord + [(None, timestr+'\n'+WelcomeStr)]
1857
- UserRecord.append((None, timestr+'\n'+WelcomeStr))
1858
  with gr.Column() as main2:
1859
  title = gr.Markdown("""# <center> STLA BABY - YOUR FRIENDLY GUIDE
1860
  <center> v0.7.1: Powered by MECH Core Team - GPT4 REMOTE MODE"""),
@@ -1962,7 +1963,7 @@ with gr.Blocks() as demo:
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")
 
1732
  # return None
1733
 
1734
  def UpdateChatbot(Running_history):
1735
+ if Running_history==[]:
1736
+
1737
+ timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
1738
  # # Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
1739
  # # yield Running_history
1740
+ WelcomeStr = """
1741
+ This is AI Assistant powered by MECH Core Team.
1742
+ It is connected remotely with GPT4. The following function is available for you.
1743
+ 1. Free Chat with AI assistant
1744
+ 2. Search Information and Engineering Data: Vector Database + Internet
1745
+ 3. Make specific task with tools:
1746
+ - Text to Sound
1747
+ - Sound to Text
1748
+ - Doc summary
1749
+ - Code interpret (Beta version)
1750
+ - Text to Image (forecast)
1751
+ """
1752
+ Running_history = Running_history + [(None, timestr+'\n'+WelcomeStr)]
1753
  # ChatbotHistory = ChatbotHistory + [(None, timestr+'\n'+WelcomeStr)]
1754
+ yield [Running_history, Running_history]
1755
 
1756
  def UpdateChatbot2(Running_history):
1757
  global ChatbotHistory
 
1855
  """
1856
  # # Running_history = Running_history + [(None, timestr+'\n'+WelcomeStr)]
1857
  # UserRecord = UserRecord + [(None, timestr+'\n'+WelcomeStr)]
1858
+ # UserRecord.append((None, timestr+'\n'+WelcomeStr))
1859
  with gr.Column() as main2:
1860
  title = gr.Markdown("""# <center> STLA BABY - YOUR FRIENDLY GUIDE
1861
  <center> v0.7.1: Powered by MECH Core Team - GPT4 REMOTE MODE"""),
 
1963
  # voice_output.play(clear_voice, None, None)
1964
 
1965
  # demo.load(read_logs, None, logs, every=1)
1966
+ demo.load(UpdateChatbot, UserRecord, [chatbot, UserRecord], every=5)
1967
  # load(UpdateChatbot, chatbot, chatbot, every=5)
1968
 
1969
  # demo(api_name="Update_Chatbot")