Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ from loguru import logger
|
|
| 14 |
from PIL import Image
|
| 15 |
from transformers import AutoProcessor, AutoModelForImageTextToText, TextIteratorStreamer
|
| 16 |
|
| 17 |
-
model_id = os.getenv("MODEL_ID", "google/medgemma-4b-it")
|
| 18 |
processor = AutoProcessor.from_pretrained(model_id)
|
| 19 |
model = AutoModelForImageTextToText.from_pretrained(
|
| 20 |
model_id, device_map="auto", torch_dtype=torch.bfloat16
|
|
@@ -206,7 +206,7 @@ def run(message: dict, history: list[dict], system_prompt: str = "", max_new_tok
|
|
| 206 |
|
| 207 |
|
| 208 |
DESCRIPTION = """\
|
| 209 |
-
This is a demo of MedGemma, a Gemma 3 variant trained for performance on medical text and image comprehension.
|
| 210 |
You can upload images, interleaved images and videos. Note that video input only supports single-turn conversation and mp4 input.
|
| 211 |
"""
|
| 212 |
|
|
@@ -221,7 +221,7 @@ demo = gr.ChatInterface(
|
|
| 221 |
gr.Slider(label="Max New Tokens", minimum=100, maximum=8192, step=10, value=2048),
|
| 222 |
],
|
| 223 |
stop_btn=True,
|
| 224 |
-
title="MedGemma 4B IT",
|
| 225 |
description=DESCRIPTION,
|
| 226 |
run_examples_on_click=False,
|
| 227 |
cache_examples=False,
|
|
|
|
| 14 |
from PIL import Image
|
| 15 |
from transformers import AutoProcessor, AutoModelForImageTextToText, TextIteratorStreamer
|
| 16 |
|
| 17 |
+
model_id = os.getenv("MODEL_ID", "google/medgemma-1.5-4b-it")
|
| 18 |
processor = AutoProcessor.from_pretrained(model_id)
|
| 19 |
model = AutoModelForImageTextToText.from_pretrained(
|
| 20 |
model_id, device_map="auto", torch_dtype=torch.bfloat16
|
|
|
|
| 206 |
|
| 207 |
|
| 208 |
DESCRIPTION = """\
|
| 209 |
+
This is a demo of MedGemma 1.5, a Gemma 3 variant trained for performance on medical text and image comprehension.
|
| 210 |
You can upload images, interleaved images and videos. Note that video input only supports single-turn conversation and mp4 input.
|
| 211 |
"""
|
| 212 |
|
|
|
|
| 221 |
gr.Slider(label="Max New Tokens", minimum=100, maximum=8192, step=10, value=2048),
|
| 222 |
],
|
| 223 |
stop_btn=True,
|
| 224 |
+
title="MedGemma 1.5 4B IT",
|
| 225 |
description=DESCRIPTION,
|
| 226 |
run_examples_on_click=False,
|
| 227 |
cache_examples=False,
|