File size: 614 Bytes
c27e6ed
 
 
 
 
 
 
 
 
 
 
 
 
8bb925c
5ecdb19
c27e6ed
5ecdb19
 
 
c27e6ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from transformers import pipeline

# Initialize the pipeline with your fine-tuned model
pipe = pipeline("text-generation", model="crystal99/my-fine-tuned-model")

# Define input prompts
input_texts = [
    "Solve this: 23 + 19?",
    "Simplify: 48 / 6.",
    "What is the square root of 64?"
]

# Generate outputs
outputs = pipe("<|startoftext|> <|user|> Hello, how are you? <|bot|>", max_length=150, temperature=0.7, top_k=50, top_p=0.9)
print(outputs)
# Display results
# for i, out in enumerate(outputs):
    # print(f"Input {i+1}: {input_texts[i]}")
    # print(f"Output {i+1}: {out['generated_text']}\n")