dstars commited on
Commit
d398646
·
verified ·
1 Parent(s): a6bc163

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -8,7 +8,6 @@ import gradio as gr
8
  from utils import load_json, init_logger
9
  from demo import ConversationalAgent, CustomTheme
10
 
11
-
12
  os.system('git lfs install')
13
  os.system("git clone https://huggingface.co/dstars/InternVL_Food")
14
 
@@ -34,8 +33,11 @@ def main():
34
  # food examples
35
  food_examples = load_json(FOOD_EXAMPLES)
36
 
 
 
37
  agent = ConversationalAgent(model_path=MODEL_PATH,
38
- outputs_dir=OUTPUT_PATH)
 
39
 
40
  theme = CustomTheme()
41
 
@@ -48,7 +50,6 @@ def main():
48
  with gr.Blocks(theme) as demo_chatbot:
49
  for title in titles:
50
  gr.Markdown(title)
51
- # gr.Markdown(article)
52
  gr.Markdown(language)
53
 
54
  with gr.Row():
@@ -119,4 +120,4 @@ def main():
119
 
120
 
121
  if __name__ == "__main__":
122
- main()
 
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
 
 
33
  # food examples
34
  food_examples = load_json(FOOD_EXAMPLES)
35
 
36
+ # Set the device to CPU explicitly
37
+ device = 'cpu'
38
  agent = ConversationalAgent(model_path=MODEL_PATH,
39
+ outputs_dir=OUTPUT_PATH,
40
+ device=device) # Pass the device to the agent
41
 
42
  theme = CustomTheme()
43
 
 
50
  with gr.Blocks(theme) as demo_chatbot:
51
  for title in titles:
52
  gr.Markdown(title)
 
53
  gr.Markdown(language)
54
 
55
  with gr.Row():
 
120
 
121
 
122
  if __name__ == "__main__":
123
+ main()