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

Use shared chat-instruct_command with api #4653

Merged
merged 1 commit into from
Nov 19, 2023

Conversation

jordanbtucker
Copy link
Contributor

Checklist:

This PR sets chat-instruct_command to the shared UI setting when called from the API, making the corresponding chat_instruct_command API parameter optional when using chat-instruct mode.

Without this PR, when calling the API with chat-instruct mode, the following error is thrown when no chat_instruct_command parameter is provided.

  File "text-generation-webui\modules\chat.py", line 93, in generate_chat_prompt
    command = state['chat-instruct_command'].replace('<|character|>', state['name2'] if not impersonate else state['name1'])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'replace'

With this PR, the API call succeeds when the chat_instruct_command parameter is not provided since it defaults to the UI setting.

@oobabooga oobabooga merged commit cb836dd into oobabooga:dev Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants