Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,12 +3,14 @@ from transformers import AutoProcessor, LlavaForConditionalGeneration
|
|
3 |
from PIL import Image
|
4 |
import torch
|
5 |
import numpy as np
|
|
|
6 |
|
7 |
# Load the Pixtral model and processor
|
8 |
model_id = "mrcuddle/lumimaid-v0.2-8b-pixtral"
|
9 |
processor = AutoProcessor.from_pretrained(model_id)
|
10 |
model = LlavaForConditionalGeneration.from_pretrained(model_id, ignore_mismatched_sizes=True).to("cuda")
|
11 |
|
|
|
12 |
def generate_text(input_text="", image=None):
|
13 |
if image is None:
|
14 |
return "Please upload an image."
|
|
|
3 |
from PIL import Image
|
4 |
import torch
|
5 |
import numpy as np
|
6 |
+
import spaces
|
7 |
|
8 |
# Load the Pixtral model and processor
|
9 |
model_id = "mrcuddle/lumimaid-v0.2-8b-pixtral"
|
10 |
processor = AutoProcessor.from_pretrained(model_id)
|
11 |
model = LlavaForConditionalGeneration.from_pretrained(model_id, ignore_mismatched_sizes=True).to("cuda")
|
12 |
|
13 |
+
@spaces.GPU
|
14 |
def generate_text(input_text="", image=None):
|
15 |
if image is None:
|
16 |
return "Please upload an image."
|