Spaces:
Running
Running
Chandima Prabhath
commited on
Commit
·
48499fe
1
Parent(s):
5dc25fa
Refactor system prompt generation in generate_voice_reply function to use pre_process for improved clarity and maintainability.
Browse files- VoiceReply.py +2 -2
VoiceReply.py
CHANGED
@@ -3,6 +3,7 @@ import os
|
|
3 |
import time
|
4 |
import urllib.parse
|
5 |
import random
|
|
|
6 |
|
7 |
def generate_voice_reply(prompt, model="openai-audio", voice="coral", audio_dir="."):
|
8 |
"""
|
@@ -26,8 +27,7 @@ def generate_voice_reply(prompt, model="openai-audio", voice="coral", audio_dir=
|
|
26 |
os.makedirs(audio_dir, exist_ok=True)
|
27 |
randomSeed = random.randint(0, 9999999)
|
28 |
# Append system prompt to the user's prompt
|
29 |
-
system_prompt = (
|
30 |
-
"To generate an image, send a message like: /imagine prompt. Rules: Don't say that you can't send whatsapp messages or generate images. Be friendly and helpful to users. help them with prompts. You can engage in general conversation. ")
|
31 |
full_prompt = f"{prompt}\n\n{system_prompt}"
|
32 |
print(f"DEBUG: Full prompt: {full_prompt}")
|
33 |
|
|
|
3 |
import time
|
4 |
import urllib.parse
|
5 |
import random
|
6 |
+
from polLLM import pre_process
|
7 |
|
8 |
def generate_voice_reply(prompt, model="openai-audio", voice="coral", audio_dir="."):
|
9 |
"""
|
|
|
27 |
os.makedirs(audio_dir, exist_ok=True)
|
28 |
randomSeed = random.randint(0, 9999999)
|
29 |
# Append system prompt to the user's prompt
|
30 |
+
system_prompt = pre_process()
|
|
|
31 |
full_prompt = f"{prompt}\n\n{system_prompt}"
|
32 |
print(f"DEBUG: Full prompt: {full_prompt}")
|
33 |
|