Spaces:
Running
on
Zero
Running
on
Zero
BramVanroy
commited on
Commit
•
4ecbc82
1
Parent(s):
b9de87a
Update app.py
Browse files
app.py
CHANGED
@@ -32,6 +32,7 @@ def generate(
|
|
32 |
top_p: float = 1.,
|
33 |
top_k: int = 50,
|
34 |
repetition_penalty: float = 1.,
|
|
|
35 |
do_sample: bool = False,
|
36 |
) -> Iterator[str]:
|
37 |
# Get Dutch date formatting locale
|
@@ -79,7 +80,7 @@ def generate(
|
|
79 |
temperature=temperature,
|
80 |
num_beams=1,
|
81 |
repetition_penalty=repetition_penalty,
|
82 |
-
no_repeat_ngram_size=
|
83 |
)
|
84 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
85 |
t.start()
|
@@ -132,6 +133,13 @@ chat_interface = gr.ChatInterface(
|
|
132 |
step=0.05,
|
133 |
value=1.,
|
134 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
gr.Checkbox(
|
136 |
label="Do sample",
|
137 |
value=False,
|
|
|
32 |
top_p: float = 1.,
|
33 |
top_k: int = 50,
|
34 |
repetition_penalty: float = 1.,
|
35 |
+
no_repeat_ngram_size: int = 4,
|
36 |
do_sample: bool = False,
|
37 |
) -> Iterator[str]:
|
38 |
# Get Dutch date formatting locale
|
|
|
80 |
temperature=temperature,
|
81 |
num_beams=1,
|
82 |
repetition_penalty=repetition_penalty,
|
83 |
+
no_repeat_ngram_size=no_repeat_ngram_size,
|
84 |
)
|
85 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
86 |
t.start()
|
|
|
133 |
step=0.05,
|
134 |
value=1.,
|
135 |
),
|
136 |
+
gr.Slider(
|
137 |
+
label="No repeat n-gram",
|
138 |
+
minimum=0,
|
139 |
+
maximum=10,
|
140 |
+
step=1,
|
141 |
+
value=4,
|
142 |
+
),
|
143 |
gr.Checkbox(
|
144 |
label="Do sample",
|
145 |
value=False,
|