mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-04-23 22:50:17 +08:00
Fix transformers dependencies for slim. (#3934)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
4b00be4173
commit
044afa83d1
@ -25,7 +25,6 @@ import base64
|
||||
from io import BytesIO
|
||||
import json
|
||||
import requests
|
||||
from transformers import GenerationConfig
|
||||
|
||||
from rag.nlp import is_english
|
||||
from api.utils import get_uuid
|
||||
@ -510,6 +509,7 @@ class GeminiCV(Base):
|
||||
return res.text,res.usage_metadata.total_token_count
|
||||
|
||||
def chat(self, system, history, gen_conf, image=""):
|
||||
from transformers import GenerationConfig
|
||||
if system:
|
||||
history[-1]["content"] = system + history[-1]["content"] + "user query: " + history[-1]["content"]
|
||||
try:
|
||||
@ -533,6 +533,7 @@ class GeminiCV(Base):
|
||||
return "**ERROR**: " + str(e), 0
|
||||
|
||||
def chat_streamly(self, system, history, gen_conf, image=""):
|
||||
from transformers import GenerationConfig
|
||||
if system:
|
||||
history[-1]["content"] = system + history[-1]["content"] + "user query: " + history[-1]["content"]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user