Spaces:
Running
Running
Chandima Prabhath
commited on
Commit
·
3470178
1
Parent(s):
291d206
Refactor audio generation prompt handling to remove system prompt from URL encoding
Browse files- VoiceReply.py +1 -2
VoiceReply.py
CHANGED
|
@@ -36,8 +36,7 @@ def generate_voice_reply(prompt, model="openai-audio", voice="coral", audio_dir=
|
|
| 36 |
print(f"DEBUG: Received prompt: {prompt}")
|
| 37 |
os.makedirs(audio_dir, exist_ok=True)
|
| 38 |
randomSeed = random.randint(0, 9999999)
|
| 39 |
-
|
| 40 |
-
encoded_prompt = urllib.parse.quote(f"system_prompt: {system_prompt}; prompt:{prompt};")
|
| 41 |
url = f"http://text.pollinations.ai/{encoded_prompt}?model={model}&voice={voice}&seed={randomSeed}"
|
| 42 |
print(f"DEBUG: Fetching audio with URL: {url}")
|
| 43 |
|
|
|
|
| 36 |
print(f"DEBUG: Received prompt: {prompt}")
|
| 37 |
os.makedirs(audio_dir, exist_ok=True)
|
| 38 |
randomSeed = random.randint(0, 9999999)
|
| 39 |
+
encoded_prompt = urllib.parse.quote(prompt)
|
|
|
|
| 40 |
url = f"http://text.pollinations.ai/{encoded_prompt}?model={model}&voice={voice}&seed={randomSeed}"
|
| 41 |
print(f"DEBUG: Fetching audio with URL: {url}")
|
| 42 |
|