scutcyr commited on
Commit
22b5bfb
·
1 Parent(s): 5c3aab0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -35,10 +35,10 @@ def answer(history, sample=True, top_p=1, temperature=0.7):
35
  preprocess_history = []
36
 
37
  for i in range(len(history)):
38
- preprocess_history.append(preprocess(text))
39
 
40
  #text = preprocess(text)
41
- #print('用户: '+text)
42
  encoding = tokenizer(text=preprocess_history, truncation=True, padding=True, max_length=768, return_tensors="pt").to(device)
43
  if not sample:
44
  out = model.generate(**encoding, return_dict_in_generate=True, output_scores=False, max_new_tokens=512, num_beams=1, length_penalty=0.6)
 
35
  preprocess_history = []
36
 
37
  for i in range(len(history)):
38
+ preprocess_history.append(preprocess(history[i]))
39
 
40
  #text = preprocess(text)
41
+ print('用户: '+preprocess_history[-1])
42
  encoding = tokenizer(text=preprocess_history, truncation=True, padding=True, max_length=768, return_tensors="pt").to(device)
43
  if not sample:
44
  out = model.generate(**encoding, return_dict_in_generate=True, output_scores=False, max_new_tokens=512, num_beams=1, length_penalty=0.6)