Spaces:
Running
Running
Saurabh Kumar
commited on
Update app.py
Browse files
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 |
-
|
11 |
-
|
12 |
-
return
|
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",
|