dstars commited on
Commit
70dacfd
·
verified ·
1 Parent(s): 2c2417f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -7,12 +7,13 @@ import gradio as gr
7
 
8
  from utils import load_json, init_logger
9
  from demo import ConversationalAgent, CustomTheme
 
10
 
11
- os.system('git lfs install')
12
- os.system("git clone https://huggingface.co/dstars/InternVL_Food")
13
 
14
  FOOD_EXAMPLES = "./demo/food_for_demo.json"
15
- MODEL_PATH = "./InternVL_Food/lr35_ep10"
16
  OUTPUT_PATH = "./outputs"
17
 
18
  def setup_seeds():
@@ -32,6 +33,7 @@ def main():
32
  init_logger(OUTPUT_PATH)
33
  # food examples
34
  food_examples = load_json(FOOD_EXAMPLES)
 
35
 
36
  # Set the device to CPU explicitly
37
  agent = ConversationalAgent(model_path=MODEL_PATH,
 
7
 
8
  from utils import load_json, init_logger
9
  from demo import ConversationalAgent, CustomTheme
10
+ from huggingface_hub import login
11
 
12
+ if os.getenv("HUGGINGFACE_TOKEN"):
13
+ login(token=os.getenv("HUGGINGFACE_TOKEN"))
14
 
15
  FOOD_EXAMPLES = "./demo/food_for_demo.json"
16
+ MODEL_PATH = "dstars/InternVL_Food/lr35_ep10"
17
  OUTPUT_PATH = "./outputs"
18
 
19
  def setup_seeds():
 
33
  init_logger(OUTPUT_PATH)
34
  # food examples
35
  food_examples = load_json(FOOD_EXAMPLES)
36
+
37
 
38
  # Set the device to CPU explicitly
39
  agent = ConversationalAgent(model_path=MODEL_PATH,