Spaces:
Runtime error
Runtime error
Commit
•
0a6aa83
1
Parent(s):
ce3c9da
Update app.py
Browse files
app.py
CHANGED
@@ -5,15 +5,13 @@ print("Token loaded")
|
|
5 |
import transformers
|
6 |
import torch
|
7 |
|
8 |
-
#
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
device="cuda",
|
16 |
-
)
|
17 |
|
18 |
print("llama download successfully")
|
19 |
|
|
|
5 |
import transformers
|
6 |
import torch
|
7 |
|
8 |
+
# Load the tokenizer and model
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct")
|
10 |
+
model = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct", device_map="auto") # to("cuda:0")
|
11 |
+
terminators = [
|
12 |
+
tokenizer.eos_token_id,
|
13 |
+
tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
14 |
+
]
|
|
|
|
|
15 |
|
16 |
print("llama download successfully")
|
17 |
|