Saurabh Kumar commited on
Commit
6d15eb6
·
verified ·
1 Parent(s): 6837700

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,9 +7,9 @@ from PIL import Image
7
  # default: Load the model on the available device(s)
8
  @st.cache_resource
9
  def init_qwen_model():
10
- model = Qwen2VLForConditionalGeneration.from_pretrained("Qwen/Qwen2-VL-7B-Instruct", torch_dtype="auto", device_map="auto")
11
- processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-7B-Instruct")
12
- return model, processor
13
  # We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
14
  # model = Qwen2VLForConditionalGeneration.from_pretrained(
15
  # "Qwen/Qwen2-VL-7B-Instruct",
 
7
  # default: Load the model on the available device(s)
8
  @st.cache_resource
9
  def init_qwen_model():
10
+ _model = Qwen2VLForConditionalGeneration.from_pretrained("Qwen/Qwen2-VL-7B-Instruct", torch_dtype="auto", device_map="auto")
11
+ _processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-7B-Instruct")
12
+ return _model, _processor
13
  # We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
14
  # model = Qwen2VLForConditionalGeneration.from_pretrained(
15
  # "Qwen/Qwen2-VL-7B-Instruct",