Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import spaces
|
|
| 9 |
|
| 10 |
from PIL import Image, ImageOps
|
| 11 |
|
| 12 |
-
#
|
| 13 |
# In your Space requirements, use:
|
| 14 |
# pip install git+https://github.com/huggingface/transformers
|
| 15 |
from transformers import AutoProcessor, Qwen3VLForConditionalGeneration
|
|
@@ -32,8 +32,8 @@ torch.set_float32_matmul_precision("high")
|
|
| 32 |
|
| 33 |
HF_TOKEN = os.environ.get("HF_TOKEN", "")
|
| 34 |
|
| 35 |
-
#
|
| 36 |
-
MODEL_ID = "
|
| 37 |
|
| 38 |
processor = None
|
| 39 |
model = None
|
|
@@ -94,7 +94,6 @@ def extract_json(text: str) -> Dict[str, Any]:
|
|
| 94 |
PROMPT = "Analyze this pantry image in detail, list every ingredient as JSON"
|
| 95 |
|
| 96 |
|
| 97 |
-
|
| 98 |
@spaces.GPU(size="large", duration=60)
|
| 99 |
def analyze_pantry(image: Image.Image) -> Tuple[Image.Image, Dict[str, Any]]:
|
| 100 |
if image is None:
|
|
@@ -176,4 +175,4 @@ with gr.Blocks() as demo:
|
|
| 176 |
|
| 177 |
|
| 178 |
demo.queue(max_size=8)
|
| 179 |
-
demo.launch()
|
|
|
|
| 9 |
|
| 10 |
from PIL import Image, ImageOps
|
| 11 |
|
| 12 |
+
# Ostrakon-VL uses the Qwen3-VL stack.
|
| 13 |
# In your Space requirements, use:
|
| 14 |
# pip install git+https://github.com/huggingface/transformers
|
| 15 |
from transformers import AutoProcessor, Qwen3VLForConditionalGeneration
|
|
|
|
| 32 |
|
| 33 |
HF_TOKEN = os.environ.get("HF_TOKEN", "")
|
| 34 |
|
| 35 |
+
# Ostrakon-VL-8B
|
| 36 |
+
MODEL_ID = "Ostrakon/Ostrakon-VL-8B"
|
| 37 |
|
| 38 |
processor = None
|
| 39 |
model = None
|
|
|
|
| 94 |
PROMPT = "Analyze this pantry image in detail, list every ingredient as JSON"
|
| 95 |
|
| 96 |
|
|
|
|
| 97 |
@spaces.GPU(size="large", duration=60)
|
| 98 |
def analyze_pantry(image: Image.Image) -> Tuple[Image.Image, Dict[str, Any]]:
|
| 99 |
if image is None:
|
|
|
|
| 175 |
|
| 176 |
|
| 177 |
demo.queue(max_size=8)
|
| 178 |
+
demo.launch()
|