retarfi commited on
Commit
8c2bc35
1 Parent(s): ac7b6c5

change top_k and top_p values

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -101,7 +101,6 @@ compress_module(model, device)
101
 
102
 
103
  def generate_prompt(instruction: str, input: Optional[str] = None):
104
- print(f"input: {input}")
105
  if input:
106
  if PROMPT_LANG == "ja":
107
  return f"以下はタスクを説明する指示とさらなる文脈を適用する入力の組み合わせです。\n\n### 指示:\n{instruction}\n\n### 入力:\n{input}\n\n### Response:\n"
@@ -163,8 +162,8 @@ def evaluate(
163
  repetition_penalty=1.0,
164
  ):
165
  num_beams: int = 1
166
- top_p: float = 1.0
167
- top_k: int = 0
168
  prompt = generate_prompt(instruction, input)
169
  inputs = tokenizer(prompt, return_tensors="pt")
170
  if len(inputs["input_ids"][0]) > max_tokens + 10:
 
101
 
102
 
103
  def generate_prompt(instruction: str, input: Optional[str] = None):
 
104
  if input:
105
  if PROMPT_LANG == "ja":
106
  return f"以下はタスクを説明する指示とさらなる文脈を適用する入力の組み合わせです。\n\n### 指示:\n{instruction}\n\n### 入力:\n{input}\n\n### Response:\n"
 
162
  repetition_penalty=1.0,
163
  ):
164
  num_beams: int = 1
165
+ top_p: float = 0.75
166
+ top_k: int = 40
167
  prompt = generate_prompt(instruction, input)
168
  inputs = tokenizer(prompt, return_tensors="pt")
169
  if len(inputs["input_ids"][0]) > max_tokens + 10: