Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import subprocess
|
| 3 |
import torch
|
| 4 |
from PIL import Image
|
| 5 |
-
from transformers import AutoProcessor,
|
| 6 |
|
| 7 |
subprocess.run(
|
| 8 |
'pip install flash-attn --no-build-isolation',
|
|
@@ -12,7 +12,7 @@ subprocess.run(
|
|
| 12 |
|
| 13 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 14 |
model = 'microsoft/Florence-2-base-ft'
|
| 15 |
-
florence_model =
|
| 16 |
model,
|
| 17 |
trust_remote_code=True).to(device).eval()
|
| 18 |
florence_processor = AutoProcessor.from_pretrained(model, trust_remote_code=True)
|
|
|
|
| 2 |
import subprocess
|
| 3 |
import torch
|
| 4 |
from PIL import Image
|
| 5 |
+
from transformers import AutoProcessor, AutoModelForConditionalGeneration
|
| 6 |
|
| 7 |
subprocess.run(
|
| 8 |
'pip install flash-attn --no-build-isolation',
|
|
|
|
| 12 |
|
| 13 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 14 |
model = 'microsoft/Florence-2-base-ft'
|
| 15 |
+
florence_model = AutoModelForConditionalGeneration.from_pretrained(
|
| 16 |
model,
|
| 17 |
trust_remote_code=True).to(device).eval()
|
| 18 |
florence_processor = AutoProcessor.from_pretrained(model, trust_remote_code=True)
|