PyCodeT5 / example.py
S-Dreamer's picture
Create example.py
43e31bb verified
# example.py
from generation_fast import CodeGenerator
generator = CodeGenerator()
nl_inputs = [
"Write a Python function to calculate the sum of two numbers.",
"Generate Python code to check if a number is prime.",
"Create a Python class for a simple calculator.",
]
for nl_input in nl_inputs:
generated_code = generator.generate_code(nl_input)
print(f"Input: {nl_input}\nGenerated Code:\n{generated_code}\n{'-'*40}")