PinoCorgi commited on
Commit
b8fb48a
1 Parent(s): f6d0c7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -3
app.py CHANGED
@@ -24,9 +24,24 @@ def generate_text(text_prompt):
24
  response = pipe(text_prompt)
25
  return response[0]['summary_text']
26
 
27
- textbox = gr.Textbox()
28
-
29
- demo = gr.Interface(generate_text, textbox, textbox)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  if __name__ == "__main__":
32
  demo.launch()
 
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 = []
31
+ mapping = {")": "(", "}": "{", "]": "["}
32
+ for char in s:
33
+ if char in mapping:
34
+ top_element = stack.pop() if stack else '#'
35
+ if mapping[char] != top_element:
36
+ return False
37
+ else:
38
+ stack.append(char)
39
+ return not stack""")
40
+
41
+ image_code = gr.Image(value = "PinoCorgi/CodeExplainerPython/code.jpg")
42
+ image_output = gr.Image(value = "PinoCorgi/CodeExplainerPython/output.jpg")
43
+
44
+ demo = gr.Interface(generate_text, textbox, textbox, image_code, image_output)
45
 
46
  if __name__ == "__main__":
47
  demo.launch()