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

from hugchat import hugchat 'type' object is not subscriptable #116

Closed
KristiKovacs opened this issue Oct 17, 2023 · 4 comments
Closed

from hugchat import hugchat 'type' object is not subscriptable #116

KristiKovacs opened this issue Oct 17, 2023 · 4 comments
Labels
bug bug!

Comments

@KristiKovacs
Copy link

Running locally using Anaconda Pycharm.

The following packages in my requirements.txt:

streamlit>=1.26.0
hugchat
streamlit-chat
streamlit-extras

Error happening at:

from hugchat import hugchat

Error message:

TypeError: 'type' object is not subscriptable
Traceback:
File "/Users/me/Desktop/SnowChatbox/venv/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 541, in _run_script
exec(code, module.dict)
File "/Users/me/Desktop/SnowChatbox/LLM_Chatbox/streamlit_app.py", line 2, in
from hugchat import hugchat
File "/Users/me/Desktop/SnowChatbox/venv/lib/python3.8/site-packages/hugchat/hugchat.py", line 18, in
class QueryResult:
File "/Users/me/Desktop/SnowChatbox/venv/lib/python3.8/site-packages/hugchat/hugchat.py", line 24, in QueryResult
web_search_sources: list[WebSearchSource]

@github-actions
Copy link

Hi! Thanks for your issue, we will deal with your issue as soon as possible.

@KristiKovacs
Copy link
Author

It turns out it was my Python version, I had 3.8 and I don't see this error with 3.9

@Soulter
Copy link
Owner

Soulter commented Oct 18, 2023

That's a bug, some new features in recent versions use new syntaxes that 3.6, 3.7 and 3.8 haven't. We will fix the problem.

https://github.com/Soulter/hugging-chat-api/actions/runs/6557522438/job/17809291093

@Soulter Soulter added the bug bug! label Oct 18, 2023
@Soulter
Copy link
Owner

Soulter commented Oct 18, 2023

Solved and updated a new version v0.3.6

@Soulter Soulter closed this as completed Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug!
Projects
None yet
Development

No branches or pull requests

2 participants