Update app.py
Browse files
app.py
CHANGED
@@ -34,21 +34,18 @@ def generate_text(message, history):
|
|
34 |
input_prompt += "[|Umano|] " + message + "\n[|Assistente|]"
|
35 |
|
36 |
print(input_prompt)
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
'stop': [
|
46 |
"[|Umano|]",
|
47 |
"[|Assistente|]",
|
48 |
],
|
49 |
-
|
50 |
-
}
|
51 |
-
output = saiga(**karg)
|
52 |
|
53 |
for out in output:
|
54 |
stream = copy.deepcopy(out)
|
@@ -59,7 +56,7 @@ def generate_text(message, history):
|
|
59 |
|
60 |
def generate_text_Dante(message, history):
|
61 |
temp = ""
|
62 |
-
input_prompt = "
|
63 |
for interaction in history:
|
64 |
input_prompt += "[|Umano|] " + interaction[0] + "\n"
|
65 |
input_prompt += "[|Assistente|]" + interaction[1]
|
@@ -67,22 +64,18 @@ def generate_text_Dante(message, history):
|
|
67 |
input_prompt += "[|Umano|] " + message + "\n[|Assistente|]"
|
68 |
|
69 |
print(input_prompt)
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
'stop': [
|
79 |
"[|Umano|]",
|
80 |
"[|Assistente|]",
|
81 |
],
|
82 |
-
|
83 |
-
}
|
84 |
-
|
85 |
-
output = dante(**karg)
|
86 |
|
87 |
for out in output:
|
88 |
stream = copy.deepcopy(out)
|
|
|
34 |
input_prompt += "[|Umano|] " + message + "\n[|Assistente|]"
|
35 |
|
36 |
print(input_prompt)
|
37 |
+
|
38 |
+
output = saiga(input_prompt,
|
39 |
+
temperature: 0.15,
|
40 |
+
top_p: 0.1,
|
41 |
+
top_k: 40,
|
42 |
+
repeat_penalty: 1.1,
|
43 |
+
max_tokens: 1024,
|
44 |
+
stop: [
|
|
|
45 |
"[|Umano|]",
|
46 |
"[|Assistente|]",
|
47 |
],
|
48 |
+
stream: True)
|
|
|
|
|
49 |
|
50 |
for out in output:
|
51 |
stream = copy.deepcopy(out)
|
|
|
56 |
|
57 |
def generate_text_Dante(message, history):
|
58 |
temp = ""
|
59 |
+
input_prompt = ""
|
60 |
for interaction in history:
|
61 |
input_prompt += "[|Umano|] " + interaction[0] + "\n"
|
62 |
input_prompt += "[|Assistente|]" + interaction[1]
|
|
|
64 |
input_prompt += "[|Umano|] " + message + "\n[|Assistente|]"
|
65 |
|
66 |
print(input_prompt)
|
67 |
+
|
68 |
+
output = dante(input_prompt,
|
69 |
+
temperature: 0.15,
|
70 |
+
top_p: 0.1,
|
71 |
+
top_k: 40,
|
72 |
+
repeat_penalty: 1.1,
|
73 |
+
max_tokens: 1024,
|
74 |
+
stop: [
|
|
|
75 |
"[|Umano|]",
|
76 |
"[|Assistente|]",
|
77 |
],
|
78 |
+
stream: True)
|
|
|
|
|
|
|
79 |
|
80 |
for out in output:
|
81 |
stream = copy.deepcopy(out)
|