allinaigc commited on
Commit
52a3d6c
1 Parent(s): a61e0e3

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -427,9 +427,11 @@ plt.rcParams['font.sans-serif'] = ['Microsoft YaHei UI']
427
 
428
  3. 你所需要分析的文件位置在:f'{file_path}/{username}/{username}_upload.csv'
429
 
430
- 4. 如果你需要作图时,你把图片保持在以下路径:f'{file_path}/{username}/{rand_num}.png'
431
  """
432
 
 
 
433
  ### 用Qwen来作为大模型输出代码。
434
  def call_with_messages(prompt, username="joeshi"):
435
 
@@ -592,7 +594,7 @@ my_orginal_question = str(prompt)
592
 
593
  print('prompt now:', prompt)
594
  print('----------'*5)
595
- def main(prompt=prompt, file_path=file_path, username="joeshi"):
596
  if prompt:
597
  st.session_state.messages.append({"role": "user", "content": prompt})
598
  with st.chat_message("user"):
@@ -622,6 +624,7 @@ def main(prompt=prompt, file_path=file_path, username="joeshi"):
622
  # folder_path = '/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/gradio/中交建/产品演示DEMO/交付_Qwen数据分析/joeshi/' ##TODO: 需要改成实际用户的目录
623
  search_string = str(rand_num)
624
 
 
625
  for filename in os.listdir(folder_path):
626
  file_path = os.path.join(folder_path, filename)
627
  if os.path.isfile(file_path) and filename.startswith(search_string):
@@ -645,7 +648,8 @@ def main(prompt=prompt, file_path=file_path, username="joeshi"):
645
 
646
  if __name__ == '__main__':
647
  # file_path = f"/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/gradio/中交建/产品演示DEMO/交付_Qwen数据分析/"
648
- main(file_path=file_path, username="joeshi")
 
649
  try:
650
  if re_btn:
651
  regenerate()
 
427
 
428
  3. 你所需要分析的文件位置在:f'{file_path}/{username}/{username}_upload.csv'
429
 
430
+ 4. 如果需要作图时,你把图片保持在以下路径:f'{file_path}/{username}/{rand_num}.png'
431
  """
432
 
433
+ print('确认sys_prompt中是否有准确的username字段', sys_prompt)
434
+
435
  ### 用Qwen来作为大模型输出代码。
436
  def call_with_messages(prompt, username="joeshi"):
437
 
 
594
 
595
  print('prompt now:', prompt)
596
  print('----------'*5)
597
+ def main(prompt=prompt, file_path=file_path):
598
  if prompt:
599
  st.session_state.messages.append({"role": "user", "content": prompt})
600
  with st.chat_message("user"):
 
624
  # folder_path = '/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/gradio/中交建/产品演示DEMO/交付_Qwen数据分析/joeshi/' ##TODO: 需要改成实际用户的目录
625
  search_string = str(rand_num)
626
 
627
+ ### 确认制定目录下是否有时间戳+随机数的图片。
628
  for filename in os.listdir(folder_path):
629
  file_path = os.path.join(folder_path, filename)
630
  if os.path.isfile(file_path) and filename.startswith(search_string):
 
648
 
649
  if __name__ == '__main__':
650
  # file_path = f"/Users/yunshi/Downloads/360Data/Data Center/Working-On Task/演讲与培训/2023ChatGPT/Coding/gradio/中交建/产品演示DEMO/交付_Qwen数据分析/"
651
+ main(file_path=file_path) ##TODO:确认用户名和地址
652
+ # main(file_path=file_path, username="joeshi")
653
  try:
654
  if re_btn:
655
  regenerate()