Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,16 @@ from transformers import StoppingCriteria, StoppingCriteriaList, TextIteratorStr
|
|
5 |
from threading import Thread
|
6 |
|
7 |
# Loading the tokenizer and model from Hugging Face's model hub.
|
8 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# using CUDA for an optimal experience
|
12 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
|
5 |
from threading import Thread
|
6 |
|
7 |
# Loading the tokenizer and model from Hugging Face's model hub.
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
9 |
+
"mlabonne/phixtral-2x2_8",
|
10 |
+
trust_remote_code=True
|
11 |
+
)
|
12 |
+
model = AutoModelForCausalLM.from_pretrained(
|
13 |
+
"mlabonne/phixtral-2x2_8",
|
14 |
+
torch_dtype="auto",
|
15 |
+
load_in_4bit=True,
|
16 |
+
trust_remote_code=True
|
17 |
+
)
|
18 |
|
19 |
# using CUDA for an optimal experience
|
20 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|