[Bug]: llama_index.llms.ollama httpx.HTTPStatusError: 服务器错误 '500 Internal Privoxy Error',对于url 'http://localhost:11434/api/chat',

vulvrdjw  于 2个月前  发布在  其他
关注(0)|答案(4)|浏览(31)

我正在使用LlamaIndex构建本地问答系统,其中LLM通过Ollama部署。起初一切正常,但当我启动全局Privoxy时,基于Ollama的LLM出现了问题。然而,基于HuggingFaceEmbedding的本地嵌入模型并没有遇到任何问题。具体的错误信息是:httpx.HTTPStatusError:服务器错误 '500 Internal Privoxy Error' 对于url ' http://localhost:11434/api/chat ' 有关更多信息,请查看:https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500

版本

0.10.55

重现步骤

embed_args = {'model_name': './bce-embedding-base_v1', 'max_length': 512, 'embed_batch_size': 32, 'device': 'cuda'}
embed_model = HuggingFaceEmbedding(**embed_args) #token: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
reranker_model = SentenceTransformerRerank(
top_n = 5,
model = "./bce-reranker-base_v1",
device='cuda'
)
llm = Ollama(model="qwen2:latest", request_timeout=60.0)
Settings.embed_model=embed_model
Settings.llm = llm
db = chromadb.PersistentClient(path="./ChromaDB")
chroma_collection = db.get_or_create_collection("MyDocuments")
vector_store = ChromaVectorStore(chroma_collection=chroma_collection)
index = VectorStoreIndex.from_vector_store(vector_store)
vector_retriever = VectorIndexRetriever(index=index, similarity_top_k=5)
response_synthesizer = get_response_synthesizer(

llm=llm,

response_mode="tree_summarize",
streaming=True
)
query_engine = RetrieverQueryEngine(
retriever=vector_retriever,
response_synthesizer=response_synthesizer,
node_postprocessors=[reranker_model],
)
query_engine.query("XX").print_response_stream()

相关日志/回溯

  • 无响应*
wf82jlnq

wf82jlnq1#

这是正确的Ollama网址吗?如果您使用了代理,可能需要更新基本网址。

fykwrbwg

fykwrbwg2#

这是正确的Ollama网址吗?如果您使用了代理,您可能需要更新基本网址。非常感谢您!
当我不使用代理时,一切都正常工作,Ollama在后台运行。那么,我现在应该使用它的绝对路径吗?

mf98qq94

mf98qq943#

不确定你所说的绝对路径是什么意思?我的意思是,如果你使用代理,http://localhost:11434可能不再是正确的URL了,对吗?
你可以修改这个,比如llm = Ollama(..., base_url="http://localhost:11434")

dz6r00yl

dz6r00yl4#

不确定你所说的绝对路径是什么意思?我的意思是,如果你使用了代理,http://localhost:11434可能不再是正确的URL了,对吗?
你可以修改这个,比如llm = Ollama(..., base_url="http://localhost:11434")
你是对的,在启用全局代理后,http://localhost:11434不再是正确的一个。然而,我现在不确定Ollama的正确端口在哪里。

相关问题