Skip to content

Commit

Permalink
Update type hints for decode_request and apply_chat_template methods
Browse files Browse the repository at this point in the history
  • Loading branch information
bhimrazy committed Feb 23, 2025
1 parent 194dd02 commit 8171cca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions litgpt/deploy/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def setup(self, device: str):
self.chat_template = chat_template


def decode_request(self, request: ChatCompletionRequest) -> Any:
def decode_request(self, request: 'ChatCompletionRequest') -> Any:
prompt = self.apply_chat_template(request.messages)
return prompt

Expand All @@ -185,7 +185,7 @@ def predict(self, inputs) -> Any:
stream=True
)

def apply_chat_template(self, messages:List[ChatMessage])-> str:
def apply_chat_template(self, messages:List['ChatMessage'])-> str:
if not _JINJA2_AVAILABLE:
raise ImportError(
"apply_chat_template requires jinja2 to be installed. Please install it using `pip install jinja2`."
Expand Down

0 comments on commit 8171cca

Please sign in to comment.