S-Dreamer commited on
Commit
43e31bb
·
verified ·
1 Parent(s): 44314b6

Create example.py

Browse files
Files changed (1) hide show
  1. example.py +14 -0
example.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # example.py
2
+ from generation_fast import CodeGenerator
3
+
4
+ generator = CodeGenerator()
5
+
6
+ nl_inputs = [
7
+ "Write a Python function to calculate the sum of two numbers.",
8
+ "Generate Python code to check if a number is prime.",
9
+ "Create a Python class for a simple calculator.",
10
+ ]
11
+
12
+ for nl_input in nl_inputs:
13
+ generated_code = generator.generate_code(nl_input)
14
+ print(f"Input: {nl_input}\nGenerated Code:\n{generated_code}\n{'-'*40}")