lorocksUMD commited on
Commit
7222efe
1 Parent(s): 2fb0735

Update script.py

Browse files
Files changed (1) hide show
  1. script.py +11 -4
script.py CHANGED
@@ -18,22 +18,29 @@ from llava.constants import (
18
  )
19
  from llava.conversation import conv_templates, SeparatorStyle
20
 
 
21
  import torch
22
  import requests
23
  from PIL import Image
24
  from io import BytesIO
25
  import re
26
 
 
 
 
 
 
 
27
 
28
  # Line 138 uncomment the cuda() to use GPUs
29
 
30
  # device = "cpu"
31
- device = "auto"
32
 
33
- prompt = "What are the things I should be cautious about when I visit here?"
34
- image_file = "Great-Room-4.jpg"
35
 
36
- model_path = "liuhaotian/llava-v1.6-mistral-7b" # <path to model weights>
37
 
38
 
39
 
 
18
  )
19
  from llava.conversation import conv_templates, SeparatorStyle
20
 
21
+ import argparse
22
  import torch
23
  import requests
24
  from PIL import Image
25
  from io import BytesIO
26
  import re
27
 
28
+ parser = argparse.ArgumentParser()
29
+ parser.add_argument("--model-path", type=str, default="liuhaotian/llava-v1.6-mistral-7b")
30
+ parser.add_argument("--image-file", type=str, required=True)
31
+ parser.add_argument("--inference-type", type=str, default="auto")
32
+ parser.add_argument("--prompt", type=str, default="Explain this image")
33
+ cmd_args = parser.parse_args()
34
 
35
  # Line 138 uncomment the cuda() to use GPUs
36
 
37
  # device = "cpu"
38
+ device = cmd_args.inference_type
39
 
40
+ prompt = cmd_args.prompt
41
+ image_file = cmd_args.image_file
42
 
43
+ model_path = cmd_args.model_path
44
 
45
 
46