Navyabhat commited on
Commit
160efdd
·
verified ·
1 Parent(s): 687e399

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -12
app.py CHANGED
@@ -93,22 +93,29 @@ with gr.Blocks() as demo:
93
  )
94
 
95
  with gr.Row():
96
- # Adding a Textbox with a placeholder "write prompt"
97
- prompt = gr.Textbox(
98
- placeholder="Ask anything", lines=2, label="Query", value=None, scale = 4
99
- )
100
-
101
- upload_btn = gr.UploadButton("📁", file_types=["image", "audio"])
102
- if upload_btn is not None and len(upload_btn) > 0:
103
- file_path = upload_btn[0].name
104
- image = gr.Image(file_path, type="filepath")
105
- audio_upload = gr.Audio(file_path, source="upload", type="filepath")
 
 
 
 
 
 
106
  audio_mic = gr.Audio(
107
- source="microphone", type="filepath", format="mp3"
 
108
  )
109
  with gr.Row():
110
  # Adding a Button
111
- submit = gr.Button(value = "Submit", variant="success")
112
  clear = gr.Button(value="Clear")
113
 
114
  submit.click(
 
93
  )
94
 
95
  with gr.Row():
96
+ # Adding a Textbox with a placeholder "write prompt"
97
+ prompt = gr.Textbox(
98
+ placeholder="Ask anything", lines=2, label="Query", value=None, scale=4
99
+ )
100
+
101
+ upload_btn = gr.UploadButton("📁", file_types=["image", "audio"])
102
+
103
+ with gr.Row():
104
+ if upload_btn.files is not None and len(upload_btn.files) > 0:
105
+ file_path = upload_btn.files[0].name
106
+ image = gr.Image(file_path, type="filepath")
107
+ audio_upload = gr.Audio(file_path, source="upload", type="filepath")
108
+ else:
109
+ image = gr.Image(type="filepath", value=None)
110
+ audio_upload = gr.Audio(source="upload", type="filepath")
111
+
112
  audio_mic = gr.Audio(
113
+ source="microphone", type="filepath", format="mp3"
114
+ )
115
  )
116
  with gr.Row():
117
  # Adding a Button
118
+ submit = gr.Button(value = "Submit", variant="primary")
119
  clear = gr.Button(value="Clear")
120
 
121
  submit.click(