Spaces:
Running
Running
updated with api key
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
import gradio as gr
|
3 |
import requests
|
4 |
import logging
|
@@ -21,19 +20,23 @@ def get_audio(input_text, usecase_id):
|
|
21 |
return f"Error: Use case with ID {usecase_id} not found."
|
22 |
|
23 |
voice_description = usecase["voice_description"]
|
24 |
-
|
25 |
-
|
|
|
26 |
# Define the API endpoint and headers
|
27 |
-
url = "https://gaganyatri-indic-
|
28 |
headers = {
|
29 |
-
"
|
30 |
"Content-Type": "application/json"
|
31 |
}
|
32 |
|
33 |
# Define the request payload
|
34 |
payload = {
|
35 |
"input": input_text,
|
36 |
-
"voice": voice_description
|
|
|
|
|
|
|
37 |
}
|
38 |
|
39 |
# Send the POST request
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
import logging
|
|
|
20 |
return f"Error: Use case with ID {usecase_id} not found."
|
21 |
|
22 |
voice_description = usecase["voice_description"]
|
23 |
+
logger.info(f"Voice Description: {voice_description}")
|
24 |
+
logger.info(f"Input Text: {input_text}")
|
25 |
+
|
26 |
# Define the API endpoint and headers
|
27 |
+
url = "https://gaganyatri-llm-indic-server-cpu.hf.space/v1/audio/speech"
|
28 |
headers = {
|
29 |
+
"X-API-Key": "your-new-secret-api-key",
|
30 |
"Content-Type": "application/json"
|
31 |
}
|
32 |
|
33 |
# Define the request payload
|
34 |
payload = {
|
35 |
"input": input_text,
|
36 |
+
"voice": voice_description,
|
37 |
+
"model": "ai4bharat/indic-parler-tts",
|
38 |
+
"response_format": "mp3",
|
39 |
+
"speed": 1.0
|
40 |
}
|
41 |
|
42 |
# Send the POST request
|