Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix(model): set model to evaluation mode (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
peakji committed Jun 25, 2023
1 parent 0288db4 commit de49385
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions basaran/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __call__(
temperature=temperature,
top_p=top_p,
),
**kwargs
**kwargs,
}

# Generate completion tokens.
Expand Down Expand Up @@ -347,4 +347,4 @@ def load_model(
if not model.can_generate():
raise TypeError(f"{name_or_path} is not a text generation model")

return StreamModel(model, tokenizer)
return StreamModel(model.eval(), tokenizer)

0 comments on commit de49385

Please sign in to comment.