avfranco commited on
Commit
3adcb28
·
1 Parent(s): d98a539

docker-image-tst

Browse files
Files changed (3) hide show
  1. .DS_Store +0 -0
  2. images/sainsburys.jpeg +0 -0
  3. main.py +10 -5
.DS_Store ADDED
Binary file (6.15 kB). View file
 
images/sainsburys.jpeg ADDED
main.py CHANGED
@@ -3,12 +3,17 @@ import gradio as gr
3
  import os
4
 
5
 
6
- def random_response(message, history):
7
- return random.choice(["Yes", "No"])
 
8
 
9
- def run():
10
- demo = gr.ChatInterface(random_response, title=os.environ.get("EXAMPLE"), description=os.environ.get("SECRET_EXAMPLE"))
11
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
 
 
 
12
 
13
  if __name__ == "__main__":
14
  run()
 
3
  import os
4
 
5
 
6
+ with gr.Blocks() as demo:
7
+ def random_response(message, history):
8
+ return random.choice(["Yes", "No"])
9
 
10
+ with gr.Tab("chat"):
11
+ gr.ChatInterface(random_response, title=os.environ.get("EXAMPLE"), description=os.environ.get("SECRET_EXAMPLE"))
12
+ with gr.Tab("image"):
13
+ gr.Image("images/sainsburys.jpeg")
14
+
15
+ def run():
16
+ demo.launch(server_name="0.0.0.0", server_port=7860, inbrowser=True)
17
 
18
  if __name__ == "__main__":
19
  run()