Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -7,16 +7,14 @@ import torch
|
|
7 |
|
8 |
# Load the model and processor
|
9 |
model_id = "microsoft/Phi-3.5-vision-instruct"
|
10 |
-
model_revision = "f2a2b357af3e062d60ca6e73a13f9f97a7fd3524" # Pin to a specific revision
|
11 |
|
12 |
model = AutoModelForCausalLM.from_pretrained(
|
13 |
model_id,
|
14 |
-
revision=model_revision,
|
15 |
trust_remote_code=True,
|
16 |
torch_dtype=torch.float16,
|
17 |
use_flash_attention_2=False, # Explicitly disable Flash Attention 2
|
18 |
)
|
19 |
-
processor = AutoProcessor.from_pretrained(model_id,
|
20 |
|
21 |
@spaces.GPU(duration=120) # Adjust the duration as needed
|
22 |
def solve_math_problem(image):
|
|
|
7 |
|
8 |
# Load the model and processor
|
9 |
model_id = "microsoft/Phi-3.5-vision-instruct"
|
|
|
10 |
|
11 |
model = AutoModelForCausalLM.from_pretrained(
|
12 |
model_id,
|
|
|
13 |
trust_remote_code=True,
|
14 |
torch_dtype=torch.float16,
|
15 |
use_flash_attention_2=False, # Explicitly disable Flash Attention 2
|
16 |
)
|
17 |
+
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True, num_crops=16)
|
18 |
|
19 |
@spaces.GPU(duration=120) # Adjust the duration as needed
|
20 |
def solve_math_problem(image):
|