Skip to content

Commit

Permalink
[MNT] Update webui.py
Browse files Browse the repository at this point in the history
  • Loading branch information
herobrine19 committed May 22, 2023
1 parent 2fbc20a commit 5807e73
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ outputs/*
data/*
!data/.gitkeep
wandb/
flagged/
.DS_Store
9 changes: 5 additions & 4 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def main(

def evaluate(
instruction,
input=None,
# input=None,
temperature=0.1,
top_p=0.75,
top_k=40,
Expand All @@ -104,6 +104,7 @@ def evaluate(
stream_output=False,
**kwargs,
):
input=None
prompt = prompter.generate_prompt(instruction, input)
inputs = tokenizer(prompt, return_tensors="pt")
input_ids = inputs["input_ids"].to(device)
Expand Down Expand Up @@ -175,9 +176,9 @@ def generate_with_streaming(**kwargs):
gr.components.Textbox(
lines=2,
label="Instruction",
placeholder="Tell me about alpacas.",
placeholder="此处输入法律相关问题",
),
gr.components.Textbox(lines=2, label="Input", placeholder="none"),
# gr.components.Textbox(lines=2, label="Input", placeholder="none"),
gr.components.Slider(
minimum=0, maximum=1, value=0.1, label="Temperature"
),
Expand All @@ -197,7 +198,7 @@ def generate_with_streaming(**kwargs):
],
outputs=[
gr.inputs.Textbox(
lines=5,
lines=8,
label="Output",
)
],
Expand Down

0 comments on commit 5807e73

Please sign in to comment.