Spaces:
Runtime error
Runtime error
import gradio as gr | |
# Define a function for user interaction (if needed) | |
def get_user_input(user_input): | |
# Here, you can process the input if necessary | |
return f"You said: {user_input}" | |
# Create the Gradio interface | |
iface = gr.Interface( | |
fn=get_user_input, | |
inputs="text", | |
outputs="text", | |
title="AI Avatar with D-ID", | |
description="Interact with your D-ID AI Avatar." | |
) | |
# Add HTML for D-ID AI Avatar | |
avatar_html = """ | |
<div> | |
<script | |
type="module" | |
src="https://agent.d-id.com/v1/index.js" | |
data-name="did-agent" | |
data-mode="fabio" | |
data-client-key="Z29vZ2dlLW9hdXRoMnwxMDE2MjgxNTc0MjI0MDkzMDQ0NzM6eUZROFMxSkRpV01NT2o0MThCQWFB" | |
data-agent-id="agt_RqZwS4UC" | |
data-monitor="true"> | |
</script> | |
</div> | |
""" | |
# Launch the Gradio interface with the HTML | |
iface.launch(share=True, inline=True) | |