dhanilka commited on
Commit
900c7ca
1 Parent(s): 7cfef6e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -7,7 +7,7 @@ from PIL import Image
7
 
8
  model_id = "adept/fuyu-8b"
9
  dtype = torch.bfloat16
10
- device = "cuda"
11
 
12
  tokenizer = AutoTokenizer.from_pretrained(model_id)
13
  model = FuyuForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=dtype)
 
7
 
8
  model_id = "adept/fuyu-8b"
9
  dtype = torch.bfloat16
10
+ device = 'cuda' if torch.cuda.is_available() else 'cpu'
11
 
12
  tokenizer = AutoTokenizer.from_pretrained(model_id)
13
  model = FuyuForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=dtype)