omkarthawakar
commited on
Commit
•
c7b0a9f
1
Parent(s):
7dbe7be
Update README.md
Browse files
README.md
CHANGED
@@ -39,6 +39,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
39 |
model = AutoModelForCausalLM.from_pretrained("MBZUAI/MobiLlama-05B", trust_remote_code=True)
|
40 |
tokenizer = AutoTokenizer.from_pretrained("MBZUAI/MobiLlama-05B", trust_remote_code=True)
|
41 |
|
|
|
42 |
text = "I was dancing in the river when "
|
43 |
input_ids = tokenizer(text, return_tensors="pt").to('cuda').input_ids
|
44 |
outputs = model.generate(input_ids, max_length=1000, repetition_penalty=1.2, pad_token_id=tokenizer.eos_token_id)
|
|
|
39 |
model = AutoModelForCausalLM.from_pretrained("MBZUAI/MobiLlama-05B", trust_remote_code=True)
|
40 |
tokenizer = AutoTokenizer.from_pretrained("MBZUAI/MobiLlama-05B", trust_remote_code=True)
|
41 |
|
42 |
+
model.to('cuda')
|
43 |
text = "I was dancing in the river when "
|
44 |
input_ids = tokenizer(text, return_tensors="pt").to('cuda').input_ids
|
45 |
outputs = model.generate(input_ids, max_length=1000, repetition_penalty=1.2, pad_token_id=tokenizer.eos_token_id)
|