Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sidjha1 committed Sep 29, 2024
1 parent d06f68c commit ecede3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lotus/models/openai_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
self.use_chat = provider in ["openai", "dbrx", "ollama"]
self.max_batch_size = max_batch_size
self.max_ctx_len = max_ctx_len
self.hf_name = hf_name if hf_name is not None else model

self.kwargs = {
"model": model,
Expand All @@ -68,7 +69,7 @@ def __init__(
if self.provider == "openai":
self.tokenizer = tiktoken.encoding_for_model(model)
else:
self.tokenizer = AutoTokenizer.from_pretrained(hf_name)
self.tokenizer = AutoTokenizer.from_pretrained(self.hf_name)

def handle_chat_request(self, messages: List, **kwargs: Dict[str, Any]) -> Union[List, Tuple[List, List]]:
"""Handle single chat request to OpenAI server.
Expand Down

0 comments on commit ecede3f

Please sign in to comment.