schoginitoys commited on
Commit
5bb27d2
·
1 Parent(s): 1875453
Files changed (1) hide show
  1. app.py +21 -2
app.py CHANGED
@@ -9,12 +9,31 @@ def generate_code(prompt):
9
  responses = generator(prompt, max_length=50, num_return_sequences=1, temperature=0.5)
10
  return responses[0]['generated_text']
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  # Create a Gradio Interface
13
  iface = gr.Interface(
14
  fn=generate_code,
15
  # inputs=[gr.inputs.Textbox(lines=10, label="Type your code description here")],
16
- inputs="text",
17
- outputs=[gr.outputs.Textbox(label="Generated Code")],
18
  examples=[["Create a Python function to add two numbers"]],
19
  )
20
 
 
9
  responses = generator(prompt, max_length=50, num_return_sequences=1, temperature=0.5)
10
  return responses[0]['generated_text']
11
 
12
+
13
+ input_textbox = gr.Textbox(label="We shall get back to you!", lines=3)
14
+ outputs = gr.Markdown()
15
+ # ex = gr.Examples(examples_list, input_textbox, examples_per_page = 50)
16
+ # demo = gr.Interface(
17
+ # fn=greet,
18
+ # inputs = [input_textbox],
19
+ # examples = examples_list,
20
+ # outputs = outputs,
21
+ # title = title,
22
+ # description="Your Python Projects Coding Companion!",
23
+ # allow_flagging="never",
24
+ # examples_per_page = 50,
25
+ # theme=gr.themes.Default(),
26
+ # )
27
+
28
+
29
+
30
+
31
  # Create a Gradio Interface
32
  iface = gr.Interface(
33
  fn=generate_code,
34
  # inputs=[gr.inputs.Textbox(lines=10, label="Type your code description here")],
35
+ inputs=input_textbox, #"text",
36
+ outputs=outputs, #[gr.outputs.Textbox(label="Generated Code")],
37
  examples=[["Create a Python function to add two numbers"]],
38
  )
39