Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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.
|
12 |
-
os.
|
13 |
|
14 |
FOOD_EXAMPLES = "./demo/food_for_demo.json"
|
15 |
-
MODEL_PATH = "
|
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,
|