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

AI doesn't start properly on OSX #7

Open
rytmisk opened this issue Sep 20, 2024 · 10 comments
Open

AI doesn't start properly on OSX #7

rytmisk opened this issue Sep 20, 2024 · 10 comments

Comments

@rytmisk
Copy link

rytmisk commented Sep 20, 2024

Describe the bug :


I have registered and inputed the API-key on blablabla and when I start the newest Qualcoder on OSX I get the following error pop up:

Traceback (most recent call last):
  File "qualcoder/ai_async_worker.py", line 117, in run

  File "qualcoder/ai_vectorstore.py", line 303, in _open_db

  File "langchain_core/_api/deprecation.py", line 203, in warn_if_direct_instance

  File "langchain_community/embeddings/huggingface.py", line 74, in __init__

ImportError: Could not import sentence_transformers python package. Please install it with `pip install sentence-transformers`.

And I have of course tested to install the sentence-transformers. But it doesn't make a difference.

To Reproduce :


Mention Steps to reproduce the behavior.

Expected behavior :


A description of what you expected to happen.

Screenshots :


If applicable, add screenshots that helps to explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context :


Add any other context about the problem here.

@rytmisk
Copy link
Author

rytmisk commented Sep 20, 2024

More information: Sometimes AI works (on some codes) but more often it does not. I attempt to analyze one with "Code Summary" and get the following error:

Traceback (most recent call last):
  File "qualcoder/ai_async_worker.py", line 117, in run

  File "qualcoder/ai_llm.py", line 309, in _ai_async_stream

  File "langchain_core/language_models/chat_models.py", line 360, in stream

  File "langchain_core/language_models/chat_models.py", line 340, in stream

  File "langchain_openai/chat_models/base.py", line 527, in _stream

TypeError: object of type 'NoneType' has no len()`
```

@rytmisk rytmisk changed the title AI Blablabla doesn't start properly on OSX AI doesn't start properly on OSX Sep 27, 2024
@rytmisk
Copy link
Author

rytmisk commented Sep 27, 2024

Another update:
I have now tried to upgrade my OSX to the latest and greatest. No difference.
Action Log is stuck on "Ai: Starting up" - and the AI chat from the text coding window does not work. Only some from the "AI Chat" window. Strange!!

@kaixxx
Copy link
Owner

kaixxx commented Oct 9, 2024

This is strange. It seems that we have multiple issues here. They could be related, but I'm not sure yet. Problem is that I don't have a mac, so I cannot reproduce it easily.

In order to narrow the problem down, please follow these steps:

  • Close QualCoder, open it again and wait for a minute so that everything can start up in the background. Please report any error messages that you get during this process.
  • Got to the AI Chat window, click on "New > New general chat" and ask the AI anything (e.g. "Make me a pizza!"). Do you get a response? This is to test if the very basic interaction with the AI model is working or not.

@rytmisk
Copy link
Author

rytmisk commented Oct 9, 2024 via email

@kaixxx
Copy link
Owner

kaixxx commented Oct 9, 2024

OK, thank you. So the initial error is still there. I was a little confused since you mentioned that the AI chat was working at times. Anyhow, I have now looked deeper into the dmg setup file for mac, and it seems that the sentence-transformers library is indeed missing.

Before asking my friend to recompile the setup file for me, I would like to check that the current code is working. Could you please try running it from source by following the instructions here: https://github.com/kaixxx/QualCoder/blob/ai_integration_rework/README.md#macos
Let me know if you need any assistance.

@rytmisk
Copy link
Author

rytmisk commented Oct 9, 2024

Thanks!
I tested and it installs fine. It also gives no error message at start. However, I experienced the same "The AI is not fully loaded" -error when attempting to ask a new general chat. But - when I changed to a different AI-engine - everything works as expected. So now every engine works in the locally compiled version. Going back to the DMG installed version - there is still no way to get passed teh "The AI is not fully loaded" error

@kaixxx
Copy link
Owner

kaixxx commented Oct 9, 2024

Nice to hear that the manually installed version works. You'll have to use this until we've compiled a new DMG.

To get around the "The AI is not fully loaded" error, you might just have to wait a little longer. When you start QualCoder, several heavy and large AI-related libraries are loaded in the background. This can take up to a minute. Try waiting until this is finished and the status bar at the bottom of the app says "AI: ready".
This process should be exactly the same no matter if you use Blablador or OpenAI. If you switch to a different model, the "AI: Starting" message is also shown, but only briefly since all the necessary libraries are already in memory.

@rytmisk
Copy link
Author

rytmisk commented Oct 9, 2024

Thanks! For me this is very good! I might ask how to uninstall at one point though - since that is the great advantage of a package.
Ketil

@kaixxx
Copy link
Owner

kaixxx commented Oct 10, 2024

Great. Is it now working with Blablador also?

When it comes to uninstalling, just delete the folder with the QualCoder code, that's all. If you used a virtual environment in python during the install, you can delete that too.

@rytmisk
Copy link
Author

rytmisk commented Oct 10, 2024

Thank you!
It is working with BlaBlador as well as with ChatGPT.
All the best!

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

No branches or pull requests

2 participants