Nymbo commited on
Commit
db34468
·
verified ·
1 Parent(s): 68682a3

adding repetition penalty

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -18,6 +18,7 @@ def respond(
18
  max_tokens,
19
  temperature,
20
  top_p,
 
21
  ):
22
  messages = [{"role": "system", "content": system_message}]
23
 
@@ -37,6 +38,7 @@ def respond(
37
  stream=True,
38
  temperature=temperature,
39
  top_p=top_p,
 
40
  messages=messages,
41
  ):
42
  token = message.choices[0].delta.content
@@ -60,6 +62,14 @@ demo = gr.ChatInterface(
60
  label="Top-P",
61
  visible=True,
62
  ),
 
 
 
 
 
 
 
 
63
 
64
  ],
65
  fill_height=True,
 
18
  max_tokens,
19
  temperature,
20
  top_p,
21
+ repetition_penalty,
22
  ):
23
  messages = [{"role": "system", "content": system_message}]
24
 
 
38
  stream=True,
39
  temperature=temperature,
40
  top_p=top_p,
41
+ repetition_penalty=repetition_penalty,
42
  messages=messages,
43
  ):
44
  token = message.choices[0].delta.content
 
62
  label="Top-P",
63
  visible=True,
64
  ),
65
+ gr.Slider(
66
+ minimum=1.0,
67
+ maximum=2.0,
68
+ value=1.2,
69
+ step=0.05,
70
+ label="Repetition penalty",
71
+ visible=True,
72
+ ),
73
 
74
  ],
75
  fill_height=True,