Spaces:
Paused
Paused
add rep slider
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def generate(
|
|
34 |
#temperature: float = 0.6,
|
35 |
#top_p: float = 0.9,
|
36 |
#top_k: int = 50,
|
37 |
-
|
38 |
) -> Iterator[str]:
|
39 |
conversation = []
|
40 |
current_input = ""
|
@@ -64,7 +64,7 @@ def generate(
|
|
64 |
#top_k=top_k,
|
65 |
#temperature=temperature,
|
66 |
#num_beams=1,
|
67 |
-
repetition_penalty=
|
68 |
)
|
69 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
70 |
t.start()
|
@@ -108,13 +108,13 @@ chat_interface = gr.ChatInterface(
|
|
108 |
# step=1,
|
109 |
# value=50,
|
110 |
# ),
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
],
|
119 |
stop_btn=None,
|
120 |
examples=[
|
|
|
34 |
#temperature: float = 0.6,
|
35 |
#top_p: float = 0.9,
|
36 |
#top_k: int = 50,
|
37 |
+
repetition_penalty: float = 1.2,
|
38 |
) -> Iterator[str]:
|
39 |
conversation = []
|
40 |
current_input = ""
|
|
|
64 |
#top_k=top_k,
|
65 |
#temperature=temperature,
|
66 |
#num_beams=1,
|
67 |
+
repetition_penalty=repetition_penalty,
|
68 |
)
|
69 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
70 |
t.start()
|
|
|
108 |
# step=1,
|
109 |
# value=50,
|
110 |
# ),
|
111 |
+
gr.Slider(
|
112 |
+
label="Repetition penalty",
|
113 |
+
minimum=1.0,
|
114 |
+
maximum=2.0,
|
115 |
+
step=0.05,
|
116 |
+
value=1.2,
|
117 |
+
),
|
118 |
],
|
119 |
stop_btn=None,
|
120 |
examples=[
|