Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -102,7 +102,7 @@ def apply_llama3_chat_template(conversation, add_generation_prompt=True):
|
|
102 |
prompt += "<|ASSISTANT|>\n"
|
103 |
return prompt
|
104 |
|
105 |
-
@spaces.GPU(duration=
|
106 |
def generate_response(message, chat_history, system_prompt, temperature, max_tokens, top_p, top_k, repetition_penalty):
|
107 |
# Build the conversation history.
|
108 |
conversation = [{"role": "system", "content": system_prompt}]
|
@@ -163,10 +163,10 @@ with gr.Blocks(css=CSS, theme=gr.themes.Soft()) as demo:
|
|
163 |
|
164 |
with gr.Accordion("⚙️ Settings", open=False):
|
165 |
system_prompt = gr.TextArea(value=DEFAULT_SYSTEM_PROMPT, label="System Instructions")
|
166 |
-
temperature = gr.Slider(0, 1, value=0.
|
167 |
max_tokens = gr.Slider(128, 32768, 32768, label="Max Response Length")
|
168 |
top_p = gr.Slider(0.0, 1.0, value=0.95, label="Top P (Nucleus Sampling)")
|
169 |
-
top_k = gr.Slider(0, 100, value=
|
170 |
repetition_penalty = gr.Slider(0.5, 2.0, value=1.1, label="Repetition Penalty")
|
171 |
|
172 |
clear = gr.Button("Clear History")
|
|
|
102 |
prompt += "<|ASSISTANT|>\n"
|
103 |
return prompt
|
104 |
|
105 |
+
@spaces.GPU(duration=360)
|
106 |
def generate_response(message, chat_history, system_prompt, temperature, max_tokens, top_p, top_k, repetition_penalty):
|
107 |
# Build the conversation history.
|
108 |
conversation = [{"role": "system", "content": system_prompt}]
|
|
|
163 |
|
164 |
with gr.Accordion("⚙️ Settings", open=False):
|
165 |
system_prompt = gr.TextArea(value=DEFAULT_SYSTEM_PROMPT, label="System Instructions")
|
166 |
+
temperature = gr.Slider(0, 1, value=0.6, label="Creativity (Temperature)")
|
167 |
max_tokens = gr.Slider(128, 32768, 32768, label="Max Response Length")
|
168 |
top_p = gr.Slider(0.0, 1.0, value=0.95, label="Top P (Nucleus Sampling)")
|
169 |
+
top_k = gr.Slider(0, 100, value=35, label="Top K")
|
170 |
repetition_penalty = gr.Slider(0.5, 2.0, value=1.1, label="Repetition Penalty")
|
171 |
|
172 |
clear = gr.Button("Clear History")
|