y0un92 commited on
Commit
5303dcb
1 Parent(s): 7d7b831

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -28,14 +28,9 @@ 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
+ # Load model directly
32
+ from transformers import AutoModel
33
+ model = AutoModel.from_pretrained("y0un92/test", trust_remote_code=True)
 
 
 
 
 
34
  tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
35
  model.eval()
36