Manasa1 commited on
Commit
69286f4
·
verified ·
1 Parent(s): d255a76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -1,8 +1,7 @@
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
@@ -14,7 +13,7 @@ iface = gr.Interface(
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
@@ -22,15 +21,19 @@ avatar_html = """
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
 
 
1
  import gradio as gr
2
 
3
+ # Function to return a simple message
4
  def get_user_input(user_input):
 
5
  return f"You said: {user_input}"
6
 
7
  # Create the Gradio interface
 
13
  description="Interact with your D-ID AI Avatar."
14
  )
15
 
16
+ # HTML for D-ID AI Avatar
17
  avatar_html = """
18
  <div>
19
  <script
 
21
  src="https://agent.d-id.com/v1/index.js"
22
  data-name="did-agent"
23
  data-mode="fabio"
24
+ data-client-key="Z29vZ2xlLW9hdXRoMnwxMDE2MjgxNTc0MjI0MDkzMDQ0NzM6eUZROFMxSkRpV01NT2o0MThCQWFB"
25
  data-agent-id="agt_RqZwS4UC"
26
  data-monitor="true">
27
  </script>
28
  </div>
29
  """
30
 
31
+ # Add the HTML component to the interface
32
+ iface.add_component(gr.HTML(avatar_html))
33
+
34
+ # Launch the Gradio interface
35
+ iface.launch(share=True)
36
+
37
 
38
 
39