Spaces:
Running
on
Zero
Running
on
Zero
BramVanroy
commited on
Commit
•
9a56c6d
1
Parent(s):
6429160
Update app.py
Browse files
app.py
CHANGED
@@ -35,29 +35,7 @@ def generate(
|
|
35 |
no_repeat_ngram_size: int = 4,
|
36 |
do_sample: bool = False,
|
37 |
) -> Iterator[str]:
|
38 |
-
|
39 |
-
try:
|
40 |
-
locale.setlocale(locale.LC_ALL, "nl-NL")
|
41 |
-
except locale.Error:
|
42 |
-
pass
|
43 |
-
|
44 |
-
now = datetime.now()
|
45 |
-
now_str = now.strftime("%B %d, %Y, %H:%M:%S")
|
46 |
-
|
47 |
-
# Reset locale
|
48 |
-
try:
|
49 |
-
locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())
|
50 |
-
except locale.Error:
|
51 |
-
pass
|
52 |
-
|
53 |
-
conversation = [
|
54 |
-
{
|
55 |
-
"role": "system",
|
56 |
-
"content": f"Je bent Fietje, een behulpzame, efficiënte en enthousiaste AI-assistent die in het Nederlands communiceert."
|
57 |
-
f" Je werd gemaakt door Bram Vanroy, een onderzoeker aan de KU Leuven en het Instituut voor de Nederlandse Taal (INT)."
|
58 |
-
f" De huidige datum en tijd is {now_str}."
|
59 |
-
}
|
60 |
-
]
|
61 |
|
62 |
for user, assistant in chat_history:
|
63 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
@@ -136,9 +114,9 @@ chat_interface = gr.ChatInterface(
|
|
136 |
gr.Slider(
|
137 |
label="No repeat n-gram",
|
138 |
minimum=0,
|
139 |
-
maximum=
|
140 |
step=1,
|
141 |
-
value=
|
142 |
),
|
143 |
gr.Checkbox(
|
144 |
label="Do sample",
|
|
|
35 |
no_repeat_ngram_size: int = 4,
|
36 |
do_sample: bool = False,
|
37 |
) -> Iterator[str]:
|
38 |
+
conversation = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
for user, assistant in chat_history:
|
41 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
|
|
114 |
gr.Slider(
|
115 |
label="No repeat n-gram",
|
116 |
minimum=0,
|
117 |
+
maximum=20,
|
118 |
step=1,
|
119 |
+
value=8,
|
120 |
),
|
121 |
gr.Checkbox(
|
122 |
label="Do sample",
|