fix gradio
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=dtype, devi
|
|
14 |
|
15 |
# Define the prompt format
|
16 |
def create_prompt(instruction):
|
17 |
-
PROMPT = '''
|
18 |
return PROMPT.format(instruction=instruction)
|
19 |
|
20 |
def respond(message, history, system_message, max_tokens, temperature, top_p):
|
@@ -32,7 +32,8 @@ demo = gr.ChatInterface(
|
|
32 |
title=gr.Markdown(title),
|
33 |
# gr.markdown(description),
|
34 |
fn=respond,
|
35 |
-
additional_inputs=[
|
|
|
36 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
37 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
38 |
gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)")
|
|
|
14 |
|
15 |
# Define the prompt format
|
16 |
def create_prompt(instruction):
|
17 |
+
PROMPT = '''Below is an instruction that describes a task.\n\nWrite a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:'''
|
18 |
return PROMPT.format(instruction=instruction)
|
19 |
|
20 |
def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
|
32 |
title=gr.Markdown(title),
|
33 |
# gr.markdown(description),
|
34 |
fn=respond,
|
35 |
+
additional_inputs=[
|
36 |
+
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
37 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
38 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
39 |
gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)")
|