Spaces:
Running
Running
æLtorio
commited on
Commit
•
db6d984
1
Parent(s):
a64397f
force cuda
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoProcessor, Idefics3ForConditionalGeneration, image_utils
|
3 |
import torch
|
4 |
-
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
5 |
print(f"Using device: {device}")
|
6 |
model_id="eltorio/IDEFICS3_ROCO"
|
7 |
# model = AutoModelForImageTextToText.from_pretrained(model_id).to(device)
|
@@ -38,4 +38,4 @@ def infere(image):
|
|
38 |
return generated_texts
|
39 |
|
40 |
radiotest = gr.Interface(fn=infere, inputs="image", outputs="text")
|
41 |
-
radiotest.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoProcessor, Idefics3ForConditionalGeneration, image_utils
|
3 |
import torch
|
4 |
+
device = torch.device('cuda') # if torch.cuda.is_available() else torch.device('cpu')
|
5 |
print(f"Using device: {device}")
|
6 |
model_id="eltorio/IDEFICS3_ROCO"
|
7 |
# model = AutoModelForImageTextToText.from_pretrained(model_id).to(device)
|
|
|
38 |
return generated_texts
|
39 |
|
40 |
radiotest = gr.Interface(fn=infere, inputs="image", outputs="text")
|
41 |
+
radiotest.launch(share=True)
|