Update app.py
Browse files
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 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
model =
|
|
|
|
| 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 |
|