Federico Galatolo
commited on
Commit
·
49d2c83
1
Parent(s):
fafd74a
new prompting style
Browse files
app.py
CHANGED
|
@@ -21,9 +21,9 @@ def generate_text(message, history):
|
|
| 21 |
input_prompt = "Conversazione tra umano ed un assistente AI di nome cerbero-7b\n"
|
| 22 |
for interaction in history:
|
| 23 |
input_prompt += "[|Umano|] " + interaction[0] + "\n"
|
| 24 |
-
input_prompt += "[|
|
| 25 |
|
| 26 |
-
input_prompt += "[|Umano|] " + message + "\n[|
|
| 27 |
|
| 28 |
print(input_prompt)
|
| 29 |
|
|
@@ -36,8 +36,7 @@ def generate_text(message, history):
|
|
| 36 |
max_tokens=1024,
|
| 37 |
stop=[
|
| 38 |
"[|Umano|]",
|
| 39 |
-
"[|
|
| 40 |
-
"[|AI|]",
|
| 41 |
],
|
| 42 |
stream=True,
|
| 43 |
)
|
|
@@ -52,7 +51,7 @@ def generate_text(message, history):
|
|
| 52 |
demo = gr.ChatInterface(
|
| 53 |
generate_text,
|
| 54 |
title="cerbero-7b running on CPU (quantized Q4_K)",
|
| 55 |
-
description="This is a quantized version of cerbero-7b running on CPU. It is less powerful than the original version, but it
|
| 56 |
examples=[
|
| 57 |
"Dammi 3 idee di ricette che posso fare con i pistacchi",
|
| 58 |
"Prepara un piano di esercizi da poter fare a casa",
|
|
|
|
| 21 |
input_prompt = "Conversazione tra umano ed un assistente AI di nome cerbero-7b\n"
|
| 22 |
for interaction in history:
|
| 23 |
input_prompt += "[|Umano|] " + interaction[0] + "\n"
|
| 24 |
+
input_prompt += "[|Assistente|]" + interaction[1]
|
| 25 |
|
| 26 |
+
input_prompt += "[|Umano|] " + message + "\n[|Assistente|]"
|
| 27 |
|
| 28 |
print(input_prompt)
|
| 29 |
|
|
|
|
| 36 |
max_tokens=1024,
|
| 37 |
stop=[
|
| 38 |
"[|Umano|]",
|
| 39 |
+
"[|Assistente|]",
|
|
|
|
| 40 |
],
|
| 41 |
stream=True,
|
| 42 |
)
|
|
|
|
| 51 |
demo = gr.ChatInterface(
|
| 52 |
generate_text,
|
| 53 |
title="cerbero-7b running on CPU (quantized Q4_K)",
|
| 54 |
+
description="This is a quantized version of cerbero-7b running on CPU (very slow). It is less powerful than the original version, but it can even run on a Raspberry Pi 4.",
|
| 55 |
examples=[
|
| 56 |
"Dammi 3 idee di ricette che posso fare con i pistacchi",
|
| 57 |
"Prepara un piano di esercizi da poter fare a casa",
|