infiniflow / infiniflow/ragflow

[Bug]: Error when using a Chat with gemini model: ModuleNotFoundError: No module named 'transformers'

Open
#9,348 5 comments 1 reaction 0 assignees View on GitHub
🐞 bug
Dominant language
Go
Stars
91k
Forks
10.8k
Avg merge
1d 14h
Merged PRs (30d)
705

Description

### Self Checks

- [x] I have searched for existing issues [search for existing issues](https://github.com/infiniflow/ragflow/issues), including closed ones.
- [x] I confirm that I am using English to submit this report ([Language Policy](https://github.com/infiniflow/ragflow/issues/5910)).
- [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) ([Language Policy](https://github.com/infiniflow/ragflow/issues/5910)).
- [x] Please do not modify this template :) and fill in all the required fields.

### RAGFlow workspace code commit ID

v0.20.1 slim

### RAGFlow image version

v0.20.1 slim

### Other environment information

```Markdown

```

### Actual behavior

When creating a chat and setting any chat model from gemini, i get this error:

Image

When using the deepseek model this does not happen:

Image

### Expected behavior

_No response_

### Steps to reproduce

```Markdown
Create a chat and set the model to any gemini chat model
Try to have a conversation
```

### Additional information

````
Traceback (most recent call last):
File "/ragflow/api/apps/conversation_app.py", line 203, in stream
for ans in chat(dia, msg, True, **req):
File "/ragflow/api/db/services/dialog_service.py", line 256, in chat
for ans in chat_solo(dialog, messages, stream):
File "/ragflow/api/db/services/dialog_service.py", line 174, in chat_solo
for ans in chat_mdl.chat_streamly(prompt_config.get("system", ""), msg, dialog.llm_setting):
File "/ragflow/api/db/services/llm_service.py", line 413, in chat_streamly
for txt in chat_partial(**kwargs):
File "/ragflow/rag/llm/cv_model.py", line 523, in chat_streamly
from transformers import GenerationConfig
ModuleNotFoundError: No module named 'transformers'
````

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with rag/llm/cv_model.py at the chat_streamly path shown in the traceback, then follow the calls through api/apps/conversation_app.py, api/db/services/dialog_service.py, and api/db/services/llm_service.py. Reproduce the issue by creating a chat with a Gemini model and verify that conversation streaming completes without the transformers import error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.