Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,14 +46,21 @@ def textGPT(text):
|
|
| 46 |
return chats
|
| 47 |
|
| 48 |
|
|
|
|
|
|
|
| 49 |
|
| 50 |
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
|
| 54 |
text = gr.Interface(fn=textGPT, inputs="text", outputs="text")
|
| 55 |
audio = gr.Interface(fn=audioGPT, inputs=gr.Audio(source="microphone", type="filepath"), outputs="text")
|
| 56 |
-
demo = gr.TabbedInterface([text, audio], [ "chatGPT", "audioGPT"])
|
| 57 |
|
| 58 |
if __name__ == "__main__":
|
| 59 |
demo.launch(enable_queue=False, auth=lambda u, p: user_db.get(u) == p,
|
|
|
|
| 46 |
return chats
|
| 47 |
|
| 48 |
|
| 49 |
+
def update(name):
|
| 50 |
+
return f"Welcome to Gradio, {name}!"
|
| 51 |
|
| 52 |
|
| 53 |
+
with gr.Blocks() as test:
|
| 54 |
+
with gr.Row():
|
| 55 |
+
inp = gr.Textbox(placeholder="What is your name?")
|
| 56 |
+
out = gr.Textbox()
|
| 57 |
+
btn = gr.Button("Clear")
|
| 58 |
+
btn.click(fn=update, inputs=inp, outputs=out)
|
| 59 |
|
| 60 |
|
| 61 |
text = gr.Interface(fn=textGPT, inputs="text", outputs="text")
|
| 62 |
audio = gr.Interface(fn=audioGPT, inputs=gr.Audio(source="microphone", type="filepath"), outputs="text")
|
| 63 |
+
demo = gr.TabbedInterface([text, audio, test], [ "chatGPT", "audioGPT", "test"])
|
| 64 |
|
| 65 |
if __name__ == "__main__":
|
| 66 |
demo.launch(enable_queue=False, auth=lambda u, p: user_db.get(u) == p,
|