Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,9 +2,14 @@ import streamlit as st
|
|
| 2 |
import torch
|
| 3 |
from transformers import AutoProcessor, PaliGemmaForConditionalGeneration
|
| 4 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Load the model and processor
|
| 7 |
model_id = "brucewayne0459/paligemma_derm"
|
|
|
|
|
|
|
| 8 |
processor = AutoProcessor.from_pretrained(model_id)
|
| 9 |
model = PaliGemmaForConditionalGeneration.from_pretrained(model_id)
|
| 10 |
model.eval()
|
|
@@ -43,10 +48,11 @@ col1, col2 = st.columns([3, 2])
|
|
| 43 |
with col1:
|
| 44 |
# File uploader for image
|
| 45 |
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
|
|
|
| 46 |
|
| 47 |
# Text input for prompt
|
| 48 |
-
input_text = st.text_input("Enter your prompt:",
|
| 49 |
-
|
| 50 |
with col2:
|
| 51 |
# Display uploaded image (if any)
|
| 52 |
if uploaded_file:
|
|
|
|
| 2 |
import torch
|
| 3 |
from transformers import AutoProcessor, PaliGemmaForConditionalGeneration
|
| 4 |
from PIL import Image
|
| 5 |
+
from transformers import AutoProcessor, AutoModelForImageTextToText
|
| 6 |
+
|
| 7 |
+
|
| 8 |
|
| 9 |
# Load the model and processor
|
| 10 |
model_id = "brucewayne0459/paligemma_derm"
|
| 11 |
+
processor_chat = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-7B-Instruct")
|
| 12 |
+
model_chat = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen2-VL-7B-Instruct")
|
| 13 |
processor = AutoProcessor.from_pretrained(model_id)
|
| 14 |
model = PaliGemmaForConditionalGeneration.from_pretrained(model_id)
|
| 15 |
model.eval()
|
|
|
|
| 48 |
with col1:
|
| 49 |
# File uploader for image
|
| 50 |
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
| 51 |
+
prompt = "Identify the skin condition?"
|
| 52 |
|
| 53 |
# Text input for prompt
|
| 54 |
+
input_text = st.text_input("Enter your prompt:", prompt)
|
| 55 |
+
|
| 56 |
with col2:
|
| 57 |
# Display uploaded image (if any)
|
| 58 |
if uploaded_file:
|