y0un92 commited on
Commit
2aa64eb
1 Parent(s): 495a1de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -27,14 +27,15 @@ assert device in ['cuda', 'mps']
27
 
28
  # Load model
29
  model_path = AutoModel.from_pretrained('openbmb/MiniCPM-Llama3-V-2_5-int4', trust_remote_code=True)
30
- if 'int4' in model_path:
31
- if device == 'mps':
32
- print('Error: running int4 model with bitsandbytes on Mac is not supported right now.')
33
- exit()
34
- model = AutoModel.from_pretrained(model_path, trust_remote_code=True)
35
- else:
36
- model = AutoModel.from_pretrained(model_path, trust_remote_code=True).to(dtype=torch.float16)
37
- model = model.to(device=device)
 
38
  tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
39
  model.eval()
40
 
 
27
 
28
  # Load model
29
  model_path = AutoModel.from_pretrained('openbmb/MiniCPM-Llama3-V-2_5-int4', trust_remote_code=True)
30
+
31
+ #if 'int4' in model_path:
32
+ #if device == 'mps':
33
+ #print('Error: running int4 model with bitsandbytes on Mac is not supported right now.')
34
+ #exit()
35
+ #model = AutoModel.from_pretrained(model_path, trust_remote_code=True)
36
+ #else:
37
+ # model = AutoModel.from_pretrained(model_path, trust_remote_code=True).to(dtype=torch.float16)
38
+ # model = model.to(device=device)
39
  tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
40
  model.eval()
41