Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] ChatModule python #1220

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions python/mlc_chat/chat_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class ConvConfig: # pylint: disable=too-many-instance-attributes
roles : Optional[List[str]]
An array that describes the role names of the user and the model. These
names are specific to the model being used.
messages : Optional[List[str]]
messages : Optional[List[List[str]]]
The chat history represented as an array of string pairs in the following
format: ``[[role_0, msg_0], [role_1, msg_1], ...]``.
offset : Optional[str]
offset : Optional[int]
The offset used to begin the chat from the chat history. When offset
is not ``0``, ``messages[0:offset-1]`` will be encoded.
separator_style : Optional[int]
Expand All @@ -69,7 +69,7 @@ class ConvConfig: # pylint: disable=too-many-instance-attributes
system: Optional[str] = None
roles: Optional[List[str]] = None
messages: Optional[List[List[str]]] = None
offset: Optional[str] = None
offset: Optional[int] = None
separator_style: Optional[int] = None
seps: Optional[List[str]] = None
role_msg_sep: Optional[str] = None
Expand Down Expand Up @@ -842,8 +842,6 @@ def generate(
if (generation_config is not None) and (generation_config.n is not None):
num_return_sequences = generation_config.n
return_str = False
else:
num_return_sequences = 1

for _ in range(num_return_sequences):
self.reset_chat()
Expand Down