PinoCorgi commited on
Commit
5a98f40
1 Parent(s): f1d68c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -24,7 +24,7 @@ def generate_text(text_prompt):
24
  response = pipe(text_prompt)
25
  return response[0]['summary_text']
26
 
27
- textbox = gr.Textbox(value = """
28
  class Solution(object):
29
  def isValid(self, s):
30
  stack = []
@@ -38,13 +38,16 @@ class Solution(object):
38
  stack.append(char)
39
  return not stack""")
40
 
 
 
41
  image_code = gr.Image(value = "https://huggingface.co/spaces/PinoCorgi/CodeExplainerPython/blob/main/code.jpg")
42
  image_output = gr.Image(value = "https://huggingface.co/spaces/PinoCorgi/CodeExplainerPython/blob/main/output.jpg")
43
 
44
- demo = gr.Interface(generate_text, textbox, textbox)
45
 
46
  image_code
47
  image_output
48
 
49
  if __name__ == "__main__":
 
50
  demo.launch()
 
24
  response = pipe(text_prompt)
25
  return response[0]['summary_text']
26
 
27
+ textbox1 = gr.Textbox(value = """
28
  class Solution(object):
29
  def isValid(self, s):
30
  stack = []
 
38
  stack.append(char)
39
  return not stack""")
40
 
41
+ textbox2 = gr.Textbox()
42
+
43
  image_code = gr.Image(value = "https://huggingface.co/spaces/PinoCorgi/CodeExplainerPython/blob/main/code.jpg")
44
  image_output = gr.Image(value = "https://huggingface.co/spaces/PinoCorgi/CodeExplainerPython/blob/main/output.jpg")
45
 
46
+ demo = gr.Interface(fn = generate_text, inputs = textbox, outputs = [textbox, image_code, image_output])
47
 
48
  image_code
49
  image_output
50
 
51
  if __name__ == "__main__":
52
+ print(f"The Inference will take approximately 1 min 30 Seconds. Attached are example images of input and output.")
53
  demo.launch()