Faustrix commited on
Commit
f3aff4b
·
1 Parent(s): 1134780

Update app.py with improved Gradio interface and change model's torch_dtype to float32

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3,10 +3,10 @@ import torch
3
  from PIL import Image
4
  from transformers import AutoModel, AutoTokenizer
5
 
6
- device = "cuda" if torch.cuda.is_available() else "cpu"
7
 
8
  # Load the model
9
- model = AutoModel.from_pretrained("openbmb/MiniCPM-Llama3-V-2_5", trust_remote_code=True, torch_dtype=torch.float16)
10
  model = model.to(device=device)
11
 
12
  # Load the tokenizer
 
3
  from PIL import Image
4
  from transformers import AutoModel, AutoTokenizer
5
 
6
+ device = "cpu"
7
 
8
  # Load the model
9
+ model = AutoModel.from_pretrained("openbmb/MiniCPM-Llama3-V-2_5", trust_remote_code=True, torch_dtype=torch.float32)
10
  model = model.to(device=device)
11
 
12
  # Load the tokenizer