Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,16 +8,16 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
|
8 |
import torch
|
9 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
10 |
|
11 |
-
model_id = '
|
12 |
-
gr.load(f"models/{model_id}").launch()
|
13 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
14 |
|
15 |
model = AutoModelForCausalLM.from_pretrained(model_id)
|
16 |
|
17 |
-
text = "TinyPixel/Llama-2-7B-bf16-sharded"
|
18 |
-
inputs = tokenizer(text, return_tensors="pt")
|
19 |
|
20 |
-
outputs = model.generate(**inputs, max_new_tokens=20)
|
21 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
22 |
|
23 |
|
|
|
8 |
import torch
|
9 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
10 |
|
11 |
+
model_id = 'TinyPixel/Llama-2-7B-bf16-sharded'
|
12 |
+
#gr.load(f"models/{model_id}").launch()
|
13 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
14 |
|
15 |
model = AutoModelForCausalLM.from_pretrained(model_id)
|
16 |
|
17 |
+
#text = "TinyPixel/Llama-2-7B-bf16-sharded"
|
18 |
+
#inputs = tokenizer(text, return_tensors="pt")
|
19 |
|
20 |
+
#outputs = model.generate(**inputs, max_new_tokens=20)
|
21 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
22 |
|
23 |
|