Spaces:
Paused
Paused
Commit
•
54b209f
1
Parent(s):
157de11
Update app.py
Browse files
app.py
CHANGED
@@ -181,7 +181,7 @@ def split_sentences(text, max_len):
|
|
181 |
# Ah, me hearty matey! But yer question be a puzzler! A human cannot eat a helicopter in one sitting, as helicopters are not edible. They be made of metal, plastic, and other materials, not food!
|
182 |
|
183 |
# Zephyr formatter
|
184 |
-
def format_prompt_zephyr(message, history, system_message
|
185 |
prompt = (
|
186 |
"<|system|>\n" + system_message + "</s>"
|
187 |
)
|
@@ -222,7 +222,7 @@ def pcm_to_wav(pcm_data, sample_rate=24000, channels=1, bit_depth=16):
|
|
222 |
def generate_local(
|
223 |
prompt,
|
224 |
history,
|
225 |
-
system_message
|
226 |
temperature=0.8,
|
227 |
max_tokens=256,
|
228 |
top_p=0.95,
|
@@ -240,8 +240,8 @@ def generate_local(
|
|
240 |
stop=stop
|
241 |
)
|
242 |
|
243 |
-
|
244 |
-
formatted_prompt = format_prompt_zephyr(prompt, history,
|
245 |
llm = llm_zephyr
|
246 |
|
247 |
|
|
|
181 |
# Ah, me hearty matey! But yer question be a puzzler! A human cannot eat a helicopter in one sitting, as helicopters are not edible. They be made of metal, plastic, and other materials, not food!
|
182 |
|
183 |
# Zephyr formatter
|
184 |
+
def format_prompt_zephyr(message, history, system_message):
|
185 |
prompt = (
|
186 |
"<|system|>\n" + system_message + "</s>"
|
187 |
)
|
|
|
222 |
def generate_local(
|
223 |
prompt,
|
224 |
history,
|
225 |
+
system_message,
|
226 |
temperature=0.8,
|
227 |
max_tokens=256,
|
228 |
top_p=0.95,
|
|
|
240 |
stop=stop
|
241 |
)
|
242 |
|
243 |
+
sys_mess = system_message.replace("##LLM_MODEL###","Zephyr").replace("##LLM_MODEL_PROVIDER###","Hugging Face")
|
244 |
+
formatted_prompt = format_prompt_zephyr(prompt, history, sys_mess)
|
245 |
llm = llm_zephyr
|
246 |
|
247 |
|