Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import AutoProcessor, Qwen2VLForConditionalGeneration
|
3 |
from PIL import Image
|
4 |
import torch
|
5 |
|
6 |
-
# Load the processor and model
|
7 |
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct")
|
8 |
-
|
|
|
9 |
|
10 |
# Streamlit app
|
11 |
st.title("Image Description Generator")
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import AutoProcessor, Qwen2VLForConditionalGeneration, AutoConfig
|
3 |
from PIL import Image
|
4 |
import torch
|
5 |
|
6 |
+
# Load the processor and model configuration
|
7 |
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct")
|
8 |
+
config = AutoConfig.from_pretrained("Qwen/Qwen2-VL-2B-Instruct")
|
9 |
+
model = Qwen2VLForConditionalGeneration.from_pretrained("Qwen/Qwen2-VL-2B-Instruct", config=config)
|
10 |
|
11 |
# Streamlit app
|
12 |
st.title("Image Description Generator")
|