Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,20 +22,6 @@ dante = Llama(
|
|
| 22 |
n_ctx=4086,
|
| 23 |
)
|
| 24 |
|
| 25 |
-
karg = {
|
| 26 |
-
'input_prompt': input_prompt,
|
| 27 |
-
'temperature': 0.15,
|
| 28 |
-
'top_p': 0.1,
|
| 29 |
-
'top_k': 40,
|
| 30 |
-
'repeat_penalty': 1.1,
|
| 31 |
-
'max_tokens': 1024,
|
| 32 |
-
'stop': [
|
| 33 |
-
"[|Umano|]",
|
| 34 |
-
"[|Assistente|]",
|
| 35 |
-
],
|
| 36 |
-
'stream': True
|
| 37 |
-
}
|
| 38 |
-
|
| 39 |
history = []
|
| 40 |
|
| 41 |
def generate_text(message, history):
|
|
@@ -49,6 +35,19 @@ def generate_text(message, history):
|
|
| 49 |
|
| 50 |
print(input_prompt)
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
output = saiga(**karg)
|
| 53 |
|
| 54 |
for out in output:
|
|
@@ -68,6 +67,20 @@ def generate_text_Dante(message, history):
|
|
| 68 |
input_prompt += "[|Umano|] " + message + "\n[|Assistente|]"
|
| 69 |
|
| 70 |
print(input_prompt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
output = dante(**karg)
|
| 73 |
|
|
|
|
| 22 |
n_ctx=4086,
|
| 23 |
)
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
history = []
|
| 26 |
|
| 27 |
def generate_text(message, history):
|
|
|
|
| 35 |
|
| 36 |
print(input_prompt)
|
| 37 |
|
| 38 |
+
karg = {
|
| 39 |
+
'input_prompt': input_prompt,
|
| 40 |
+
'temperature': 0.15,
|
| 41 |
+
'top_p': 0.1,
|
| 42 |
+
'top_k': 40,
|
| 43 |
+
'repeat_penalty': 1.1,
|
| 44 |
+
'max_tokens': 1024,
|
| 45 |
+
'stop': [
|
| 46 |
+
"[|Umano|]",
|
| 47 |
+
"[|Assistente|]",
|
| 48 |
+
],
|
| 49 |
+
'stream': True
|
| 50 |
+
}
|
| 51 |
output = saiga(**karg)
|
| 52 |
|
| 53 |
for out in output:
|
|
|
|
| 67 |
input_prompt += "[|Umano|] " + message + "\n[|Assistente|]"
|
| 68 |
|
| 69 |
print(input_prompt)
|
| 70 |
+
|
| 71 |
+
karg = {
|
| 72 |
+
'input_prompt': input_prompt,
|
| 73 |
+
'temperature': 0.15,
|
| 74 |
+
'top_p': 0.1,
|
| 75 |
+
'top_k': 40,
|
| 76 |
+
'repeat_penalty': 1.1,
|
| 77 |
+
'max_tokens': 1024,
|
| 78 |
+
'stop': [
|
| 79 |
+
"[|Umano|]",
|
| 80 |
+
"[|Assistente|]",
|
| 81 |
+
],
|
| 82 |
+
'stream': True
|
| 83 |
+
}
|
| 84 |
|
| 85 |
output = dante(**karg)
|
| 86 |
|