æLtorio commited on
Commit
ca9f0b9
1 Parent(s): db6d984

fallback to cpu

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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)
 
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)