Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| # Function to return a simple message | |
| def get_user_input(user_input): | |
| 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." | |
| ) | |
| # 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="Z29vZ2xlLW9hdXRoMnwxMDE2MjgxNTc0MjI0MDkzMDQ0NzM6eUZROFMxSkRpV01NT2o0MThCQWFB" | |
| data-agent-id="agt_RqZwS4UC" | |
| data-monitor="true"> | |
| </script> | |
| </div> | |
| """ | |
| # Add the HTML component to the interface | |
| iface.get_component(gr.HTML(avatar_html)) | |
| # Launch the Gradio interface | |
| iface.launch(share=True) | |