Spaces:
Runtime error
Runtime error
Rename main.py to app.py
Browse files
app.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
# Function to embed the D-ID agent into Gradio
|
4 |
+
def embed_did_agent():
|
5 |
+
html_code = """
|
6 |
+
<script
|
7 |
+
type="module"
|
8 |
+
src="https://agent.d-id.com/v1/index.js"
|
9 |
+
data-name="did-agent"
|
10 |
+
data-mode="fabio"
|
11 |
+
data-client-key="Z29vZ2xlLW9hdXRoMnwxMDQ5Nzg0NTA5MTE0MTMxMzE0Nzk6T0x2TnRSbVBlWVdyemhxajg1bkp0"
|
12 |
+
data-agent-id="agt_yGKAc5pK"
|
13 |
+
data-monitor="true">
|
14 |
+
</script>
|
15 |
+
"""
|
16 |
+
return html_code
|
17 |
+
|
18 |
+
# Gradio interface
|
19 |
+
with gr.Blocks() as app:
|
20 |
+
gr.HTML(embed_did_agent())
|
21 |
+
|
22 |
+
# Launch the Gradio interface
|
23 |
+
app.launch()
|
24 |
+
|
25 |
+
|
main.py
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
|
|