y0un92 commited on
Commit
7d7b831
·
verified ·
1 Parent(s): c4d3da0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -28,14 +28,14 @@ assert device in ['cuda', 'mps']
28
  # Load model
29
  model_path = 'y0un92/test'
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
 
 
28
  # Load model
29
  model_path = 'y0un92/test'
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