broadfield commited on
Commit
337771f
·
verified ·
1 Parent(s): fefaa11

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from huggingface_hub import InferenceClient, HfApi, list_files_info
2
  #from html2image import Html2Image
3
  import gradio as gr
4
  #import markdown
@@ -13,6 +13,8 @@ import json
13
  #import bs4
14
  import re
15
  import os
 
 
16
  loc_folder="chat_history"
17
  loc_file="chat_json"
18
  user_="community-pool/"
@@ -48,7 +50,7 @@ def format_prompt(message, mod, system):
48
  return prompt
49
  def generate(prompt,history,mod=2,tok=4000,seed=1,role="ASSISTANT",data=None):
50
  #print("#####",history,"######")
51
- file_list = list_files_info(f'{user_}{repo_}')
52
  print('file list\n',file_list)
53
  gen_images=False
54
  client=InferenceClient(clients[int(mod)]['name'])
 
1
+ from huggingface_hub import InferenceClient, HfApi, HfFileSystem
2
  #from html2image import Html2Image
3
  import gradio as gr
4
  #import markdown
 
13
  #import bs4
14
  import re
15
  import os
16
+ fs = HfFileSystem()
17
+
18
  loc_folder="chat_history"
19
  loc_file="chat_json"
20
  user_="community-pool/"
 
50
  return prompt
51
  def generate(prompt,history,mod=2,tok=4000,seed=1,role="ASSISTANT",data=None):
52
  #print("#####",history,"######")
53
+ file_list = fs.ls(f'{user_}{repo_}',detail=False)
54
  print('file list\n',file_list)
55
  gen_images=False
56
  client=InferenceClient(clients[int(mod)]['name'])