Skip to content

Commit

Permalink
Update predict using history.
Browse files Browse the repository at this point in the history
Signed-off-by: ldwang <[email protected]>
  • Loading branch information
ldwang committed Oct 18, 2023
1 parent 3875aa9 commit 7b610ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flagai/model/aquila2/modeling_aquila.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ def predict(self, text, tokenizer=None,
probs = probs[1:]

# Update history
history.insert(0, ('USER', text))
history.insert(0, ('ASSISTANT', out))
history.insert(0, ('USER', text))

return out

Expand Down
2 changes: 1 addition & 1 deletion flagai/model/aquila2_hf/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def predict(model, text, tokenizer=None,
probs = probs[1:]

# Update history
history.insert(0, ('USER', text))
history.insert(0, ('ASSISTANT', out))
history.insert(0, ('USER', text))

return out

0 comments on commit 7b610ed

Please sign in to comment.