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

Text LIME in dashboard returns an error #738

Closed
SarahAlidoost opened this issue Mar 27, 2024 · 0 comments · Fixed by #799
Closed

Text LIME in dashboard returns an error #738

SarahAlidoost opened this issue Mar 27, 2024 · 0 comments · Fixed by #799
Assignees
Labels
bug Something isn't working

Comments

@SarahAlidoost
Copy link
Contributor

When selecting LIME in the text explanations, it returns an error:

TypeError: Error due to following unused kwargs: {'rand_state': 2}
Traceback:
File "/home/sarah/miniconda3/envs/dianna/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
    exec(code, module.__dict__)
File "/home/sarah/GitHub/dianna/dianna/dashboard/pages/2_Text.py", line 84, in <module>
    relevances = func(model_runner, text_input, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarah/miniconda3/envs/dianna/lib/python3.11/site-packages/streamlit/runtime/caching/cache_utils.py", line 212, in wrapper
    return cached_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarah/miniconda3/envs/dianna/lib/python3.11/site-packages/streamlit/runtime/caching/cache_utils.py", line 241, in __call__
    return self._get_or_create_cached_value(args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarah/miniconda3/envs/dianna/lib/python3.11/site-packages/streamlit/runtime/caching/cache_utils.py", line 268, in _get_or_create_cached_value
    return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarah/miniconda3/envs/dianna/lib/python3.11/site-packages/streamlit/runtime/caching/cache_utils.py", line 324, in _handle_cache_miss
    computed_value = self._info.func(*func_args, **func_kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarah/GitHub/dianna/dianna/dashboard/_models_text.py", line 30, in _run_lime_text
    relevances = explain_text(_model, text, tokenizer, method='LIME', **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sarah/GitHub/dianna/dianna/__init__.py", line 113, in explain_text
    raise TypeError(f'Error due to following unused kwargs: {kwargs}')

Currently, there is no test to show this. There should be a fix and a test.

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

Successfully merging a pull request may close this issue.

3 participants