|
@@ -45,13 +45,13 @@ model.eval()
|
|
|
|
|
|
|
|
|
|
|
|
|
def evaluate(
|
|
def evaluate(
|
|
|
- instruction,
|
|
|
|
|
- temperature=0.1,
|
|
|
|
|
- top_p=0.75,
|
|
|
|
|
- top_k=40,
|
|
|
|
|
- num_beams=4,
|
|
|
|
|
- input=None,
|
|
|
|
|
- **kwargs,
|
|
|
|
|
|
|
+ instruction,
|
|
|
|
|
+ input=None,
|
|
|
|
|
+ temperature=0.1,
|
|
|
|
|
+ top_p=0.75,
|
|
|
|
|
+ top_k=40,
|
|
|
|
|
+ num_beams=4,
|
|
|
|
|
+ **kwargs,
|
|
|
):
|
|
):
|
|
|
prompt = generate_prompt(instruction, input)
|
|
prompt = generate_prompt(instruction, input)
|
|
|
inputs = tokenizer(prompt, return_tensors="pt")
|
|
inputs = tokenizer(prompt, return_tensors="pt")
|
|
@@ -82,6 +82,9 @@ gr.Interface(
|
|
|
gr.components.Textbox(
|
|
gr.components.Textbox(
|
|
|
lines=2, label="Instruction", placeholder="Tell me about alpacas."
|
|
lines=2, label="Instruction", placeholder="Tell me about alpacas."
|
|
|
),
|
|
),
|
|
|
|
|
+ gr.components.Textbox(
|
|
|
|
|
+ lines=2, label="Input", placeholder="none"
|
|
|
|
|
+ ),
|
|
|
gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
|
|
gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
|
|
|
gr.components.Slider(minimum=0, maximum=1, value=0.75, label="Top p"),
|
|
gr.components.Slider(minimum=0, maximum=1, value=0.75, label="Top p"),
|
|
|
gr.components.Slider(minimum=0, maximum=100, step=1, value=40, label="Top k"),
|
|
gr.components.Slider(minimum=0, maximum=100, step=1, value=40, label="Top k"),
|