Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,9 @@ import transformers
|
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig,AwqConfig
|
5 |
import torch
|
6 |
import os
|
7 |
-
|
8 |
from huggingface_hub import login
|
9 |
-
|
10 |
|
11 |
|
12 |
nf4_config = BitsAndBytesConfig(
|
@@ -16,12 +16,12 @@ nf4_config = BitsAndBytesConfig(
|
|
16 |
bnb_4bit_compute_dtype=torch.bfloat16
|
17 |
)
|
18 |
|
19 |
-
model_id = "
|
20 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
21 |
model = AutoModelForCausalLM.from_pretrained(model_id,
|
22 |
# load_in_8bit=True,
|
23 |
-
quantization_config=nf4_config,
|
24 |
-
|
25 |
device_map="auto"
|
26 |
)
|
27 |
|
|
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig,AwqConfig
|
5 |
import torch
|
6 |
import os
|
7 |
+
key = os.environ.get("key")
|
8 |
from huggingface_hub import login
|
9 |
+
login(key)
|
10 |
|
11 |
|
12 |
nf4_config = BitsAndBytesConfig(
|
|
|
16 |
bnb_4bit_compute_dtype=torch.bfloat16
|
17 |
)
|
18 |
|
19 |
+
model_id = "Viet-Mistral/Vistral-7B-Chat"
|
20 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
21 |
model = AutoModelForCausalLM.from_pretrained(model_id,
|
22 |
# load_in_8bit=True,
|
23 |
+
# quantization_config=nf4_config,
|
24 |
+
torch_dtype = torch.bfloat16,
|
25 |
device_map="auto"
|
26 |
)
|
27 |
|