YanshekWoo commited on
Commit
287e49e
1 Parent(s): 1a934e9

update generate parameters

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -34,12 +34,14 @@ def chat_func(input_utterance: str, history: Optional[List[str]] = None):
34
  return_tensors='pt',
35
  truncation=True,
36
  max_length=max_length,
37
- top_p=0.95,
38
- do_sample=True,
39
- num_beams=4).input_ids
40
 
41
  output_ids = model.generate(input_ids,
42
- max_new_tokens=30)[0]
 
 
 
 
43
  response = tokenizer.decode(output_ids, skip_special_tokens=True)
44
 
45
  history.append(response)
 
34
  return_tensors='pt',
35
  truncation=True,
36
  max_length=max_length,
37
+ ).input_ids
 
 
38
 
39
  output_ids = model.generate(input_ids,
40
+ max_new_tokens=30,
41
+ top_p=0.95,
42
+ do_sample=True,
43
+ num_beams=4)[0]
44
+
45
  response = tokenizer.decode(output_ids, skip_special_tokens=True)
46
 
47
  history.append(response)