gamingflexer commited on
Commit
31446a8
·
1 Parent(s): 22451a2

Add app2.py with voice input and product ID functionality

Browse files
Files changed (1) hide show
  1. src/app2.py +23 -0
src/app2.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import pandas as pd
3
+ import os
4
+
5
+ OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
6
+ SEVER_IP = os.environ.get("SEVER_IP")
7
+
8
+ def sample_fun(voice_input, prodcut_id):
9
+ print(prodcut_id)
10
+ return
11
+
12
+ with gr.Blocks(theme=gr.themes.Default(primary_hue=gr.themes.colors.red, secondary_hue=gr.themes.colors.pink)) as demo:
13
+
14
+ with gr.Tab("Add Your Image"):
15
+ voice_input = gr.Audio(label="Upload Audio")
16
+ prodcut_id = gr.Textbox(label="Enter Product ID")
17
+ with gr.Row():
18
+ submit_button_tab_1 = gr.Button("Start")
19
+
20
+
21
+ submit_button_tab_1.click(fn=sample_fun,inputs=[voice_input,prodcut_id])
22
+
23
+ demo.launch(server_name="0.0.0.0",server_port=9003)