Update utils.py
Browse files
utils.py
CHANGED
@@ -14,17 +14,10 @@ from transformers import StoppingCriteria, StoppingCriteriaList
|
|
14 |
|
15 |
hf_auth = os.getenv('hf_auth')
|
16 |
# LLM Model
|
17 |
-
model_id = '
|
18 |
|
19 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
20 |
|
21 |
-
bnb_config = transformers.BitsAndBytesConfig(
|
22 |
-
load_in_4bit=True,
|
23 |
-
bnb_4bit_quant_type='nf4',
|
24 |
-
bnb_4bit_use_double_quant=True,
|
25 |
-
bnb_4bit_compute_dtype=bfloat16
|
26 |
-
)
|
27 |
-
|
28 |
model_config = transformers.AutoConfig.from_pretrained(
|
29 |
model_id,
|
30 |
use_auth_token=hf_auth
|
@@ -34,7 +27,6 @@ llm_model = transformers.AutoModelForCausalLM.from_pretrained(
|
|
34 |
model_id,
|
35 |
trust_remote_code=True,
|
36 |
config=model_config,
|
37 |
-
quantization_config=bnb_config,
|
38 |
device_map='auto',
|
39 |
use_auth_token=hf_auth
|
40 |
)
|
|
|
14 |
|
15 |
hf_auth = os.getenv('hf_auth')
|
16 |
# LLM Model
|
17 |
+
model_id = 'google-t5/t5-base'
|
18 |
|
19 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
model_config = transformers.AutoConfig.from_pretrained(
|
22 |
model_id,
|
23 |
use_auth_token=hf_auth
|
|
|
27 |
model_id,
|
28 |
trust_remote_code=True,
|
29 |
config=model_config,
|
|
|
30 |
device_map='auto',
|
31 |
use_auth_token=hf_auth
|
32 |
)
|