File size: 645 Bytes
5d34cfc 5ce70ac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
---
license: apache-2.0
---
```
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model = "sam2ai/falcon-base-1b-odia-pt"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
device_map="auto",
)
sequences = pipeline(
"ମୁଁ ହେବାକୁ ଚାହେଁ",
max_length=1024,
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
print(f"Result: {seq['generated_text']}")
``` |