Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,11 @@ import gradio as gr
|
|
5 |
from transformers import LlavaNextProcessor, LlavaNextForConditionalGeneration
|
6 |
|
7 |
model_path = "ibm-granite/granite-vision-3.1-2b-preview"
|
8 |
-
processor = LlavaNextProcessor.from_pretrained(
|
|
|
|
|
|
|
|
|
9 |
model = LlavaNextForConditionalGeneration.from_pretrained(model_path, torch_dtype="auto", device_map="auto")
|
10 |
|
11 |
@spaces.GPU()
|
|
|
5 |
from transformers import LlavaNextProcessor, LlavaNextForConditionalGeneration
|
6 |
|
7 |
model_path = "ibm-granite/granite-vision-3.1-2b-preview"
|
8 |
+
processor = LlavaNextProcessor.from_pretrained(
|
9 |
+
model_path,
|
10 |
+
use_fast=True,
|
11 |
+
image_processor_type = 'llava_next'
|
12 |
+
)
|
13 |
model = LlavaNextForConditionalGeneration.from_pretrained(model_path, torch_dtype="auto", device_map="auto")
|
14 |
|
15 |
@spaces.GPU()
|