kouki321 commited on
Commit
2fb73b9
·
verified ·
1 Parent(s): 35c42fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -88,14 +88,16 @@ def load_model_and_tokenizer(doc_text_count):
88
  # Load the pre-trained model with quantization
89
  model = AutoModelForCausalLM.from_pretrained(
90
  model_name,
91
- device_map="auto", # Automatically allocate model to devices
92
- model_max_length=1.3*round(doc_text_count * 0.3 + 1),
93
- token=HF_TOKEN
94
  )
95
 
96
  # Load the tokenizer
97
  tokenizer = AutoTokenizer.from_pretrained(
98
- model_name
 
 
99
  ,token=HF_TOKEN
100
  )
101
  return tokenizer, model
 
88
  # Load the pre-trained model with quantization
89
  model = AutoModelForCausalLM.from_pretrained(
90
  model_name,
91
+ trust_remote_code=True,
92
+ model_max_length=1.3*round(doc_text_count * 0.3 + 1)
93
+ ,token=HF_TOKEN
94
  )
95
 
96
  # Load the tokenizer
97
  tokenizer = AutoTokenizer.from_pretrained(
98
+ model_name,
99
+ trust_remote_code=True,
100
+ model_max_length=1.3*round(doc_text_count * 0.3 + 1)
101
  ,token=HF_TOKEN
102
  )
103
  return tokenizer, model