wakeupmh commited on
Commit
bf36826
·
1 Parent(s): 5f3cb01

fix: cuda error

Browse files
Files changed (2) hide show
  1. app.py +2 -3
  2. requirements.txt +1 -2
app.py CHANGED
@@ -21,9 +21,8 @@ def load_models():
21
  tokenizer = AutoTokenizer.from_pretrained(model_name)
22
  model = AutoModelForSeq2SeqLM.from_pretrained(
23
  model_name,
24
- device_map="auto",
25
- load_in_8bit=True,
26
- trust_remote_code=True
27
  )
28
  return tokenizer, model
29
 
 
21
  tokenizer = AutoTokenizer.from_pretrained(model_name)
22
  model = AutoModelForSeq2SeqLM.from_pretrained(
23
  model_name,
24
+ torch_dtype=torch.float16,
25
+ low_cpu_mem_usage=True
 
26
  )
27
  return tokenizer, model
28
 
requirements.txt CHANGED
@@ -6,5 +6,4 @@ faiss-cpu
6
  arxiv
7
  --extra-index-url https://download.pytorch.org/whl/cpu
8
  torch
9
- accelerate>=0.26.0
10
- bitsandbytes>=0.41.1
 
6
  arxiv
7
  --extra-index-url https://download.pytorch.org/whl/cpu
8
  torch
9
+ accelerate>=0.26.0