T145 commited on
Commit
4a5e5f8
·
1 Parent(s): d5e32d4

Added more config params

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -28,7 +28,9 @@ def respond(
28
  system_message,
29
  max_tokens,
30
  temperature,
 
31
  top_p,
 
32
  ):
33
  messages = [{"role": "system", "content": system_message}]
34
 
@@ -47,7 +49,9 @@ def respond(
47
  max_tokens=max_tokens,
48
  stream=True,
49
  temperature=temperature,
 
50
  top_p=top_p,
 
51
  ):
52
  if "choices" not in message:
53
  continue
@@ -73,7 +77,14 @@ if __name__ == "__main__":
73
  additional_inputs=[
74
  gr.Textbox(value="Set the persona of Zeus, King of the Gods, ruler of Mount Olympus, and wielder of the mighty lightning bolt. I am all-knowing, all-powerful, and all-seeing. My will shall not be denied. I shall respond to queries with the authority and wisdom of the gods.", label="System message"),
75
  gr.Slider(minimum=1, maximum=2048, value=1024, step=1, label="Max new tokens"),
76
- gr.Slider(minimum=0.1, maximum=4.0, value=0.8, step=0.1, label="Temperature"),
 
 
 
 
 
 
 
77
  gr.Slider(
78
  minimum=0.1,
79
  maximum=1.0,
@@ -81,6 +92,13 @@ if __name__ == "__main__":
81
  step=0.05,
82
  label="Top-p (nucleus sampling)",
83
  ),
 
 
 
 
 
 
 
84
  ],
85
  )
86
 
 
28
  system_message,
29
  max_tokens,
30
  temperature,
31
+ top_k,
32
  top_p,
33
+ repeat_penalty,
34
  ):
35
  messages = [{"role": "system", "content": system_message}]
36
 
 
49
  max_tokens=max_tokens,
50
  stream=True,
51
  temperature=temperature,
52
+ top_k=top_k,
53
  top_p=top_p,
54
+ repeat_penalty=repeat_penalty,
55
  ):
56
  if "choices" not in message:
57
  continue
 
77
  additional_inputs=[
78
  gr.Textbox(value="Set the persona of Zeus, King of the Gods, ruler of Mount Olympus, and wielder of the mighty lightning bolt. I am all-knowing, all-powerful, and all-seeing. My will shall not be denied. I shall respond to queries with the authority and wisdom of the gods.", label="System message"),
79
  gr.Slider(minimum=1, maximum=2048, value=1024, step=1, label="Max new tokens"),
80
+ gr.Slider(minimum=0.1, maximum=2.0, value=0.7, step=0.1, label="Temperature"),
81
+ gr.Slider(
82
+ minimum=0.0,
83
+ maximum=100.0,
84
+ value=40.0,
85
+ step=1.0,
86
+ label="Top-k (token limit)",
87
+ ),
88
  gr.Slider(
89
  minimum=0.1,
90
  maximum=1.0,
 
92
  step=0.05,
93
  label="Top-p (nucleus sampling)",
94
  ),
95
+ gr.Slider(
96
+ minimum=0.0,
97
+ maximum=2.0,
98
+ value=1.1,
99
+ step=0.1,
100
+ label="Repetition penalty",
101
+ ),
102
  ],
103
  )
104