JunchuanYu commited on
Commit
393f574
1 Parent(s): caf32c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -2,14 +2,24 @@ import gradio as gr
2
  import os
3
  import sys
4
  import argparse
5
- from utils import *
6
- from chat_func import *
7
-
8
  my_api_key = os.environ.get('my_api_key')
9
 
10
  if my_api_key == "empty":
11
  print("Please give a api key!")
12
  sys.exit(1)
 
 
 
 
 
 
 
 
 
 
13
 
14
  gr.Chatbot.postprocess = postprocess
15
 
 
2
  import os
3
  import sys
4
  import argparse
5
+
6
+ from huggingface_hub import hf_hub_download
7
+
8
  my_api_key = os.environ.get('my_api_key')
9
 
10
  if my_api_key == "empty":
11
  print("Please give a api key!")
12
  sys.exit(1)
13
+
14
+ token = os.environ['HUB_TOKEN']
15
+ loc1 =hf_hub_download(repo_id="JunchuanYu/files_sydney", filename="utils.py",repo_type="dataset",local_dir='.',token=token)
16
+ loc2 =hf_hub_download(repo_id="JunchuanYu/files_sydney", filename="chat_func.py",repo_type="dataset",local_dir='.',token=token)
17
+
18
+ sys.path.append(loc1)
19
+ sys.path.append(loc2)
20
+
21
+ from utils import *
22
+ from chat_func import *
23
 
24
  gr.Chatbot.postprocess = postprocess
25