Spaces:
Runtime error
Runtime error
update temperature and top_p default values
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ def predict(inputs, top_p, temperature, openai_api_key, history=[]):
|
|
14 |
payload = {
|
15 |
"model": "gpt-3.5-turbo",
|
16 |
"messages": [{"role": "user", "content": f"{inputs}"}],
|
17 |
-
"temperature" : 1.0,
|
18 |
-
"top_p":1.0,
|
19 |
"n" : 1,
|
20 |
"stream": True,
|
21 |
"presence_penalty":0,
|
@@ -87,8 +87,8 @@ with gr.Blocks(css = """#col_container {width: 700px; margin-left: auto; margin-
|
|
87 |
|
88 |
#inputs, top_p, temperature, top_k, repetition_penalty
|
89 |
with gr.Accordion("Parameters", open=False):
|
90 |
-
top_p = gr.Slider( minimum=-0, maximum=1.0, value=0
|
91 |
-
temperature = gr.Slider( minimum=-0, maximum=5.0, value=0
|
92 |
#top_k = gr.Slider( minimum=1, maximum=50, value=4, step=1, interactive=True, label="Top-k",)
|
93 |
#repetition_penalty = gr.Slider( minimum=0.1, maximum=3.0, value=1.03, step=0.01, interactive=True, label="Repetition Penalty", )
|
94 |
|
|
|
14 |
payload = {
|
15 |
"model": "gpt-3.5-turbo",
|
16 |
"messages": [{"role": "user", "content": f"{inputs}"}],
|
17 |
+
"temperature" : temperature, #1.0,
|
18 |
+
"top_p": top_p, #1.0,
|
19 |
"n" : 1,
|
20 |
"stream": True,
|
21 |
"presence_penalty":0,
|
|
|
87 |
|
88 |
#inputs, top_p, temperature, top_k, repetition_penalty
|
89 |
with gr.Accordion("Parameters", open=False):
|
90 |
+
top_p = gr.Slider( minimum=-0, maximum=1.0, value=1.0, step=0.05, interactive=True, label="Top-p (nucleus sampling)",)
|
91 |
+
temperature = gr.Slider( minimum=-0, maximum=5.0, value=1.0, step=0.1, interactive=True, label="Temperature",)
|
92 |
#top_k = gr.Slider( minimum=1, maximum=50, value=4, step=1, interactive=True, label="Top-k",)
|
93 |
#repetition_penalty = gr.Slider( minimum=0.1, maximum=3.0, value=1.03, step=0.01, interactive=True, label="Repetition Penalty", )
|
94 |
|