Skip to content

Commit

Permalink
add test for the generate_response
Browse files Browse the repository at this point in the history
  • Loading branch information
MAfarrag committed Aug 20, 2024
1 parent 490968a commit 4247aa5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ def test_create_chat_model(model_id: str) -> ChatModel:
return chat_mode


def test_generate_response(test_create_chat_model: ChatModel):
response = test_create_chat_model.generate_response(
question="what is cmake?", context=""
)
expected_response = "CMake is"
assert response.__contains__(expected_response)


class TestChatTemplate:
def test_template_does_not_exist(self):
template = ChatModel._read_chat_template(model_id="does-not-exist")
Expand Down

0 comments on commit 4247aa5

Please sign in to comment.