Spaces:
Runtime error
Runtime error
bhaskartripathi
commited on
Commit
•
6724136
1
Parent(s):
6063fe1
Update app.py
Browse files
app.py
CHANGED
@@ -70,38 +70,24 @@ def chatbot(user_prompt,openAI_key):
|
|
70 |
else:
|
71 |
output_file = "output.mp4"
|
72 |
chat_and_animate(output_file, user_prompt,openAI_key)
|
73 |
-
return output_file
|
74 |
-
|
75 |
-
'''
|
76 |
-
gr.Interface(
|
77 |
-
fn=chatbot,
|
78 |
-
inputs=gr.inputs.Textbox(label="Ask me anything", placeholder="Type your question and press enter"),
|
79 |
-
outputs=gr.outputs.Video(),
|
80 |
-
allow_flagging=False,
|
81 |
-
flagging_options=[],
|
82 |
-
title="Deep talks with Lisa !",
|
83 |
-
description="Ask me anything, and I'll give you an animated response! Type 'Welcome' to load the chat assistant.",
|
84 |
-
theme="compact"
|
85 |
-
).launch()
|
86 |
-
'''
|
87 |
-
|
88 |
|
89 |
with gr.Blocks() as demo:
|
90 |
gr.Markdown(f'<center><h1>Ask Lisa !</h1></center>')
|
91 |
gr.Markdown(f'<center><p>Powered by <a href="https://www.bhaskartripathi.com">www.bhaskartripathi.com</a></p></center>')
|
92 |
gr.Markdown(f'<span><img src="https://i.imgur.com/ork8hoP.gif" width="100" height="100"></span>')
|
93 |
with gr.Row():
|
94 |
-
|
95 |
with gr.Group():
|
96 |
gr.Markdown(f'<p style="text-align:center">Get your Open AI API key <a href="https://platform.openai.com/account/api-keys">here</a></p>')
|
97 |
openAI_key=gr.Textbox(label='Enter your OpenAI API key here')
|
98 |
question = gr.Textbox(label='Ask me anything, and I will give you an animated response! Enteryour question here')
|
99 |
btn = gr.Button(value='Talk')
|
100 |
-
|
101 |
btn.style(full_width=True)
|
102 |
with gr.Group():
|
103 |
-
output_video = gr.outputs.
|
104 |
btn.click(chatbot, inputs=[question,openAI_key], outputs=[output_video])
|
105 |
#openai.api_key = os.getenv('Your_Key_Here')
|
106 |
|
107 |
-
demo.launch()
|
|
|
70 |
else:
|
71 |
output_file = "output.mp4"
|
72 |
chat_and_animate(output_file, user_prompt,openAI_key)
|
73 |
+
return f'<video width="200" height="200" controls><source src="{output_file}" type="video/mp4"></video>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
with gr.Blocks() as demo:
|
76 |
gr.Markdown(f'<center><h1>Ask Lisa !</h1></center>')
|
77 |
gr.Markdown(f'<center><p>Powered by <a href="https://www.bhaskartripathi.com">www.bhaskartripathi.com</a></p></center>')
|
78 |
gr.Markdown(f'<span><img src="https://i.imgur.com/ork8hoP.gif" width="100" height="100"></span>')
|
79 |
with gr.Row():
|
80 |
+
|
81 |
with gr.Group():
|
82 |
gr.Markdown(f'<p style="text-align:center">Get your Open AI API key <a href="https://platform.openai.com/account/api-keys">here</a></p>')
|
83 |
openAI_key=gr.Textbox(label='Enter your OpenAI API key here')
|
84 |
question = gr.Textbox(label='Ask me anything, and I will give you an animated response! Enteryour question here')
|
85 |
btn = gr.Button(value='Talk')
|
86 |
+
|
87 |
btn.style(full_width=True)
|
88 |
with gr.Group():
|
89 |
+
output_video = gr.outputs.HTML()
|
90 |
btn.click(chatbot, inputs=[question,openAI_key], outputs=[output_video])
|
91 |
#openai.api_key = os.getenv('Your_Key_Here')
|
92 |
|
93 |
+
demo.launch()
|