Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ import traceback
|
|
7 |
import re
|
8 |
import torch
|
9 |
import argparse
|
|
|
10 |
from transformers import AutoModel, AutoTokenizer
|
11 |
|
12 |
# README, How to run demo on different devices
|
@@ -25,7 +26,7 @@ device = args.device
|
|
25 |
assert device in ['cuda', 'mps']
|
26 |
|
27 |
# Load model
|
28 |
-
model_path = AutoModel.from_pretrained("openbmb/MiniCPM-Llama3-V-2_5", trust_remote_code=True)
|
29 |
if 'int4' in model_path:
|
30 |
if device == 'mps':
|
31 |
print('Error: running int4 model with bitsandbytes on Mac is not supported right now.')
|
|
|
7 |
import re
|
8 |
import torch
|
9 |
import argparse
|
10 |
+
import numpy as np
|
11 |
from transformers import AutoModel, AutoTokenizer
|
12 |
|
13 |
# README, How to run demo on different devices
|
|
|
26 |
assert device in ['cuda', 'mps']
|
27 |
|
28 |
# Load model
|
29 |
+
model_path = AutoModel.from_pretrained("openbmb/MiniCPM-Llama3-V-2_5", trust_remote_code=True,torch_dtype=torch.float32, device_map="auto")
|
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.')
|