Skip to content

Commit

Permalink
add debug message when model is loading
Browse files Browse the repository at this point in the history
  • Loading branch information
nattvara committed Apr 19, 2024
1 parent 6728b61 commit da348f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llms/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@

from .sampling_strategies import top_k_sampling, top_p_sampling, top_k_and_p_sampling
from config.settings import get_settings
from config.logger import log
from .config import Params


def load_hf_model(model_path: str, device: str) -> (AutoModelForCausalLM, AutoTokenizer):
log().debug(f"loading model {model_path} with token {get_settings().HUGGINGFACE_ACCESS_TOKEN}")

tokenizer = AutoTokenizer.from_pretrained(model_path, token=get_settings().HUGGINGFACE_ACCESS_TOKEN)
model = AutoModelForCausalLM.from_pretrained(
model_path,
Expand Down

0 comments on commit da348f3

Please sign in to comment.