Spaces:
Runtime error
Runtime error
Commit
·
f8a241e
1
Parent(s):
9c82439
Update app.py
Browse files
app.py
CHANGED
@@ -3,3 +3,9 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
3 |
|
4 |
tokenizer = AutoTokenizer.from_pretrained("TheCraftySlayer/Llama-2-70b-chat-hf")
|
5 |
model = AutoModelForCausalLM.from_pretrained("TheCraftySlayer/Llama-2-70b-chat-hf")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
tokenizer = AutoTokenizer.from_pretrained("TheCraftySlayer/Llama-2-70b-chat-hf")
|
5 |
model = AutoModelForCausalLM.from_pretrained("TheCraftySlayer/Llama-2-70b-chat-hf")
|
6 |
+
input_text =" hello how are you?"
|
7 |
+
inputs= tokenizer.encode(input_text, return_tensors='pt')
|
8 |
+
outputs= model.generate(inputs,max_length=50,num_return_sequences=5,temperature=0.7)
|
9 |
+
print("Generated Text")
|
10 |
+
for i, output in enumerate(outputs):
|
11 |
+
print({f"{i}: {tokenizer.decode(output)}")
|