File size: 345 Bytes
b7c45c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from transformers import pipeline

generator = pipeline(
    "text-generation",
    model="CohereLabs/tiny-aya-base",
    torch_dtype="bfloat16",
)

output = generator(
    "The capital of Spain is",
    max_new_tokens=128,
    do_sample=True,
    temperature=0.1,
    top_p=0.9,
    repetition_penalty=1.1,
)
print(output[0]["generated_text"])