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

Providing allowed models in the config breaks settings UI #815

Closed
DzmitrySudnik opened this issue Jun 3, 2024 · 1 comment · Fixed by #855
Closed

Providing allowed models in the config breaks settings UI #815

DzmitrySudnik opened this issue Jun 3, 2024 · 1 comment · Fixed by #855
Labels
bug Something isn't working

Comments

@DzmitrySudnik
Copy link

Description

After one of recent upgrades (either 2.16 or 2.15, I suspect this PR cf20800) config UI stopped working for me. Seems it's related to the allowed models I have configured. Removing allowed_models from the config solves the issue, however I need to control the allowed models.

Reproduce

  1. Create a config file with allowed_models list
  2. Restart jupyterlab
  3. Go to Jupyter AI settings
  4. You will see "Error: Unhandled error"

Expected behavior

No error on UI

Context

example of the config file:

{
  "AiExtension": {
    "allowed_models": [
      "bedrock-chat:anthropic.claude-v2",
      "bedrock-chat:anthropic.claude-v2:1",
      "bedrock-chat:anthropic.claude-3-sonnet-20240229-v1:0",
      "bedrock:amazon.titan-embed-text-v1"
    ]
 }
}

error in jupyterlab:

  File "/opt/conda/lib/python3.11/site-packages/tornado/web.py", line 1788, in _execute
    result = method(*self.path_args, **self.path_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/tornado/web.py", line 3301, in wrapper
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/jupyter_ai/handlers.py", line 353, in get
    providers = self._filter_blocked_models(providers)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/jupyter_ai/handlers.py", line 293, in _filter_blocked_models
    provider.chat_models = list(filter(filter_predicate, provider.chat_models))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable```
@DzmitrySudnik DzmitrySudnik added the bug Something isn't working label Jun 3, 2024
@3coins
Copy link
Collaborator

3coins commented Jun 21, 2024

@DzmitrySudnik
Thanks for reporting this issue. I can reproduce this issue when either of allowed_models or blocked_models is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants