billvsme / law_ai

💼法律AI助手,法律RAG,通过全部200+本法律手册📖、网页搜索内容💻结合LLM回答你的问题,并且给出相应的法规和网站,基于⚡️ langchain,Gradio,openai,chroma,duckduckgo-search
https://law.vmaig.com/
100 stars 17 forks source link

为什么我换成本地的大模型问问题怎么没有回答啊? #1

Open kuang1216 opened 8 months ago

weisuzhou commented 7 months ago

你好,请问你解决了吗?求指教

zhuzhu-2008 commented 6 months ago

你好请问解决了吗?是格式不符还是什么问题,也没有报错 修改了utils.py def get_model( model: str = "http://XXX/v1", #"gpt-3.5-turbo-0613", streaming: bool = True, callbacks: Callbacks = None) -> ChatOpenAI:

model = ChatOpenAI(model=model, streaming=streaming, callbacks=callbacks)

model = ChatOpenAI(
    streaming=streaming,
    verbose=True,
    callbacks=callbacks,
    openai_api_key="none",
    openai_api_base=model,
    model_name="XXX"
)
return model
zhuzhu-2008 commented 6 months ago

还是会报错: Retrying langchain_community.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/embeddings (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fa8b3ff6ac0>: Failed to establish a new connection: [Errno 101] Network is unreachable')).