Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
|
| 3 |
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
# Define a function for user interaction (if needed)
|
| 4 |
+
def get_user_input(user_input):
|
| 5 |
+
# Here, you can process the input if necessary
|
| 6 |
+
return f"You said: {user_input}"
|
| 7 |
+
|
| 8 |
+
# Create the Gradio interface
|
| 9 |
+
iface = gr.Interface(
|
| 10 |
+
fn=get_user_input,
|
| 11 |
+
inputs="text",
|
| 12 |
+
outputs="text",
|
| 13 |
+
title="AI Avatar with D-ID",
|
| 14 |
+
description="Interact with your D-ID AI Avatar."
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
# Add HTML for D-ID AI Avatar
|
| 18 |
+
avatar_html = """
|
| 19 |
+
<div>
|
| 20 |
+
<script
|
| 21 |
+
type="module"
|
| 22 |
+
src="https://agent.d-id.com/v1/index.js"
|
| 23 |
+
data-name="did-agent"
|
| 24 |
+
data-mode="fabio"
|
| 25 |
+
data-client-key="Z29vZ2dlLW9hdXRoMnwxMDE2MjgxNTc0MjI0MDkzMDQ0NzM6eUZROFMxSkRpV01NT2o0MThCQWFB"
|
| 26 |
+
data-agent-id="agt_RqZwS4UC"
|
| 27 |
+
data-monitor="true">
|
| 28 |
+
</script>
|
| 29 |
+
</div>
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
# Launch the Gradio interface with the HTML
|
| 33 |
+
iface.launch(share=True, inline=True)
|
| 34 |
|
| 35 |
|
| 36 |
|