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

[Bug]: ERROR: 'NoneType' object has no attribute 'encode_queries' #3173

Closed
1 task done
SummerDream233 opened this issue Nov 4, 2024 · 10 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@SummerDream233
Copy link

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch name

main

Commit ID

8d9238d

Other environment information

No response

Actual behavior

When I want to ask question with any chatbot, the problem encounter:

Expected behavior

No response

Steps to reproduce

Pull the latest code from github and pull the latest docker version (dev-slim)
Start enquery

Additional information

Traceback (most recent call last):
File "/ragflow/api/apps/conversation_app.py", line 181, in stream
for ans in chat(dia, msg, True, **req):
File "/ragflow/api/db/services/dialog_service.py", line 210, in chat
kbinfos = retr.retrieval(" ".join(questions), embd_mdl, tenant_ids, dialog.kb_ids, 1, dialog.top_n,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ragflow/rag/nlp/search.py", line 380, in retrieval
sres = self.search(req, [index_name(tid) for tid in tenant_ids], embd_mdl, highlight)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ragflow/rag/nlp/search.py", line 129, in search
s["knn"] = self._vector(
^^^^^^^^^^^^^
File "/ragflow/rag/nlp/search.py", line 58, in _vector
qv, c = emb_mdl.encode_queries(txt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ragflow/api/db/services/llm_service.py", line 217, in encode_queries
emd, used_tokens = self.mdl.encode_queries(query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ragflow/rag/llm/embedding_model.py", line 92, in encode_queries
return self._model.encode_queries([text]).tolist()[0], token_count
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode_queries'

@SummerDream233 SummerDream233 added the bug Something isn't working label Nov 4, 2024
@SummerDream233
Copy link
Author

Hello, I want to know the reason and whether it cause influence for everyone.
I note that all chat do not work in the latest version, but the offical demo website (ragflow.io) can conduct enquiry normally.
If you encounter difficulties in reproducing the problem, please feel free to contact me at any time.
I really hope that the related bugs can be fixed as soon as possible.
I didn't expect to fix a bug just now. Now a new bug has appeared again.

@SummerDream233
Copy link
Author

At the same time, the front end page will display:
image

@SummerDream233
Copy link
Author

The back end will display:
image

@SummerDream233
Copy link
Author

I try to pull new docker image, and the problem still remain.
But there is no bug in the offical website (ragflow.io). I don't know why this happened.

@KevinHuSh
Copy link
Collaborator

It seems not embedding model found.
What is KB's embedding model?

KevinHuSh added a commit that referenced this issue Nov 5, 2024
### What problem does this PR solve?

#3173 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
@SummerDream233
Copy link
Author

It seems not embedding model found. What is KB's embedding model?

image

@SummerDream233
Copy link
Author

It seems not embedding model found. What is KB's embedding model?

Hello. I pull the code from github and the lastest docker image (dev-slim), and the problem still remain.

At the same time, the bug report is the same, and it display 'NoneType' object has no attribute 'encode_queries'.

I note that you add the related code to test whether embedding model exist. But I do not know am I operating correctly.

Do I need to connect Docker image to my local code? Or docker image already contains the running code?

@SummerDream233
Copy link
Author

I come to update this bug.

I find you have updated the docker image. After I change the .env to ragflow:dev, the problem is missing.

But I am not sure if this bug will still exist when .env switching to ragflow:dev-slim.

Since the code is now ready to run when using ragflow:dev, I may not update this issue again.

Thank you for your cooperation! LOVE YOU!

@showmaker-hub
Copy link

I come to update this bug.

I find you have updated the docker image. After I change the .env to ragflow:dev, the problem is missing.

But I am not sure if this bug will still exist when .env switching to ragflow:dev-slim.

Since the code is now ready to run when using ragflow:dev, I may not update this issue again.

Thank you for your cooperation! LOVE YOU!

How can I reproduce your operation? I also encountered the same problem. Thank you

@SummerDream233
Copy link
Author

I come to update this bug.
I find you have updated the docker image. After I change the .env to ragflow:dev, the problem is missing.
But I am not sure if this bug will still exist when .env switching to ragflow:dev-slim.
Since the code is now ready to run when using ragflow:dev, I may not update this issue again.
Thank you for your cooperation! LOVE YOU!

How can I reproduce your operation? I also encountered the same problem. Thank you

  1. change the .env file
  2. pull the Docker image again

More detailed information about the specific operation can be found in this project homepage.

jhaiq pushed a commit to jhaiq/ragflow that referenced this issue Nov 30, 2024
### What problem does this PR solve?

infiniflow#3173 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
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

No branches or pull requests

3 participants