ollama使用caused by nameresolutionerror

docker pull dsadockuser/ollama-qwen2

vi /root/.condarc
curl http://127.0.0.1:11434/api/chat -d ‘{
“model”: “qwen:0.5b”,
“messages”: [
{ “role”: “user”, “content”: “介绍一下北京景点?” }
],
“stream”: false
}’

llm: api_key: ${GRAPHRAG_API_KEY} type: openai_chat # or azure_openai_chat model: Qwen2-72B-Instruct model_supports_json: false max_tokens: 2000 # request_timeout: 180.0 api_base: http://11.0.0.1:8000/v1 # 根据部署的实际情况进行更改 tokens_per_minute: 30000 requests_per_minute: 30 top_p: 0.99 # top-p sampling embeddings: ## parallelization: override the global parallelization settings for embeddings async_mode: threaded llm: api_key: xinference type: openai_embedding model: bge-m3 api_base: http://10.0.0.1:9998/v1 # 根据部署的实际情况进行更改

{
“type”: “error”,
“data”: “Entity Extraction Error”,
“stack”: “Traceback (most recent call last):\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/index/graph/extractors/graph/graph_extractor.py”, line 122, in call\n result = await self._process_document(text, prompt_variables)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/index/graph/extractors/graph/graph_extractor.py”, line 150, in _process_document\n response = await self._llm(\n ^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/openai/json_parsing_llm.py”, line 34, in call\n result = await self._delegate(input, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/openai/openai_token_replacing_llm.py”, line 37, in call\n return await self._delegate(input, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/openai/openai_history_tracking_llm.py”, line 33, in call\n output = await self._delegate(input, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/base/caching_llm.py”, line 96, in call\n result = await self._delegate(input, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/base/rate_limiting_llm.py”, line 177, in call\n result, start = await execute_with_retry()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/base/rate_limiting_llm.py”, line 159, in execute_with_retry\n async for attempt in retryer:\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/tenacity/asyncio/init.py”, line 166, in anext\n do = await self.iter(retry_state=self._retry_state)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/tenacity/asyncio/init.py”, line 153, in iter\n result = await action(retry_state)\n ^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/tenacity/_utils.py”, line 99, in inner\n return call(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/tenacity/init.py”, line 398, in \n self._add_action_func(lambda rs: rs.outcome.result())\n ^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/concurrent/futures/_base.py”, line 449, in result\n return self.__get_result()\n ^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/concurrent/futures/_base.py”, line 401, in __get_result\n raise self._exception\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/base/rate_limiting_llm.py”, line 165, in execute_with_retry\n return await do_attempt(), start\n ^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/base/rate_limiting_llm.py”, line 147, in do_attempt\n return await self._delegate(input, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/base/base_llm.py”, line 50, in call\n return await self._invoke(input, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/base/base_llm.py”, line 54, in _invoke\n output = await self._execute_llm(input, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/graphrag/llm/openai/openai_chat_llm.py”, line 53, in _execute_llm\n completion = await self.client.chat.completions.create(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/openai/resources/chat/completions.py”, line 1412, in create\n return await self._post(\n ^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/openai/_base_client.py”, line 1831, in post\n return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/openai/_base_client.py”, line 1525, in request\n return await self._request(\n ^^^^^^^^^^^^^^^^^^^^\n File “/home/alex/929ollama-qwen2/py311/lib/python3.11/site-packages/openai/_base_client.py”, line 1626, in _request\n raise self._make_status_error_from_response(err.response) from None\nopenai.NotFoundError: 404 page not found\n”,
“source”: “404 page not found”,
“details”: {
“doc_index”: 0,
“text”: “of the\nstate of Mississippi and granted tax exempt status by the Internal\nRevenue Service. The Foundation’s EIN or federal tax identification\nnumber is 64-6221541. Contributions to the Project Gutenberg Literary\nArchive Foundation are tax deductible to the full extent permitted by\nU.S. federal laws and your state’s laws.\n\nThe Foundation’s business office is located at 809 North 1500 West,\nSalt Lake City, UT 84116, (801) 596-1887. Email contact links and up\nto date contact information can be found at the Foundation’s website\nand official page at www.gutenberg.org/contact\n\nSection 4. Information about Donations to the Project Gutenberg\nLiterary Archive Foundation\n\nProject Gutenberg™ depends upon and cannot survive without widespread\npublic support and donations to carry out its mission of\nincreasing the number of public domain and licensed works that can be\nfreely distributed in machine-readable form accessible by the widest\narray of equipment including outdated equipment. Many small donations\n($1 to $5,000) are particularly important to maintaining tax exempt\nstatus with the IRS.\n\nThe Foundation is committed to complying with the laws regulating\ncharities and charitable donations in all 50 states of the United\nStates. Compliance requirements are not uniform and it takes a\nconsiderable effort, much paperwork and many fees to meet and keep up\nwith these requirements. We do not solicit donations in locations\nwhere we have not received written confirmation of compliance. To SEND\nDONATIONS or determine the status of compliance for any particular state\nvisit www.gutenberg.org/donate.\n\nWhile we cannot and do not solicit contributions from states where we\nhave not met the solicitation requirements, we know of no prohibition\nagainst accepting unsolicited donations from donors in such states who\napproach us with offers to donate.\n\nInternational donations are gratefully accepted, but we cannot make\nany statements concerning tax treatment of donations received from\noutside the United States. U.S. laws alone swamp our small staff.\n\nPlease check the Project Gutenberg web pages for current donation\nmethods and addresses. Donations are accepted in a number of other\nways including checks, online payments and credit card donations. To\ndonate, please visit: www.gutenberg.org/donate.\n\nSection 5. General Information About Project Gutenberg™ electronic works\n\nProfessor Michael S. Hart was the originator of the Project\nGutenberg™ concept of a library of electronic works that could be\nfreely shared with anyone. For forty years, he produced and\ndistributed Project Gutenberg™ eBooks with only a loose network of\nvolunteer support.\n\nProject Gutenberg™ eBooks are often created from several printed\neditions, all of which are confirmed as not protected by copyright in\nthe U.S. unless a copyright notice is included. Thus, we do not\nnecessarily keep eBooks in compliance with any particular paper\nedition.\n\nMost people start at our website which has the main PG”
}
从您提供的错误信息来看,问题出在调用OpenAI API时出现了404 Not Found错误。这通常意味着请求的URL无法找到,可能是由于API端点不正确或者API的服务暂时不可用。

分析错误来源

错误堆栈显示问题出现在graphrag.index.graph.extractors.graph.graph_extractor模块中的_process_document函数调用时,这里涉及到与OpenAI API的交互。具体的错误信息是“404 page not found”,这可能是因为以下原因:

  1. API URL错误:确保您使用的API URL是正确的。
  2. API密钥问题:确认您的API密钥是有效的,并且已经正确配置。
  3. 服务端问题:OpenAI的服务可能暂时不可用或者正在进行维护。
  4. 网络问题:您的网络连接可能存在问题,无法访问外部服务。

解决方法

1. 检查API URL和密钥

确认您的OpenAI API URL和API密钥是否正确。您可以在OpenAI的文档中查找正确的API端点,并确保API密钥已经正确设置在环境变量或者代码中。

2. 网络诊断

检查是否有防火墙或代理设置阻止了对外部服务的访问。您可以尝试ping OpenAI的服务器地址来确认网络连通性。

3. 使用其他工具测试API

您可以使用Postman或curl命令来直接测试OpenAI的API端点,以确定问题是否在于您的应用程序配置。

例如,使用curl命令测试API:

curl -X POST https://api.openai.com/v1/chat/completions \-H "Authorization: Bearer YOUR_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "gpt-3.5-turbo","messages": [{"role": "user", "content": "Hello!"}]
}'

请将YOUR_API_KEY替换为您的实际API密钥。

4. 检查依赖库版本

确认您使用的依赖库(如graphrag, openai等)版本是最新的,或者与您的项目兼容。

5. 查看OpenAI状态页面

有时候OpenAI平台本身可能会有临时性的服务中断,您可以通过访问OpenAI的状态页面来查看当前的服务状态。

如果上述方法都无法解决问题,请提供更多的上下文信息,以便进一步诊断问题。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/1550544.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

C++系列-继承

🌈个人主页:羽晨同学 💫个人格言:“成为自己未来的主人~” 继承的概念和定义 继承是面向对象程序设计使代码可以复用的最重要的手段,它允许程序员在保持原有类特性的基础上进行拓展,增加功能,这样可以…

【PyTorch】生成对抗网络

生成对抗网络是什么 Generative Adversarial Nets,简称GAN GAN:生成对抗网络 —— 一种可以生成特定分布数据的模型 《Recent Progress on Generative Adversarial Networks (GANs): A Survey》 《How Generative Adversarial Networks and Its Varian…

基于Megatron-LM从0到1完成GPT2模型预训练、模型评估及推理

随着 ChatGPT 迅速爆火,引领基于Transformer架构的大模型从幕后走到台前。但 ChatGPT 的成功并不是一蹴而就,而是,经过了从早期的 GPT1 到 GPT2,之后到 GPT3 和 InstructGPT、然后到GPT3.5和ChatGPT,直到如今的多模态大…

一钉多用:自攻螺钉在家居与工业领域的广泛应用

自攻螺钉的结构要素有哪些重要特点? 自攻螺钉适用于非金属或软金属,不需要配合预先开好的孔和攻牙。自攻螺钉的尖头设计使其能够“自我攻入”材料中;而普通螺丝通常是平头,规格一致。自攻螺钉的关键在于,打孔时不需要进…

【JavaEE初阶】网络原理

欢迎关注个人主页:逸狼 创造不易,可以点点赞吗~ 如有错误,欢迎指出~ 目录 ⽹络互连 IP地址 端口号 协议 协议分层 优势 TCP/IP 五层网络模型 数据在网络通信中的整体流程 封装和分用 封装 分用 ⽹络互连 随着时代的发展,越来越需…

Angular基础学习(入门 --> 入坑)

目录 一、Angular 环境搭建 二、创建Angular新项目 三、数据绑定 四、ngFor循环、ngIf、ngSwitch、[ngClass]、[ngStyle]、管道、事件、双向数据绑定--MVVM 五、DOM 操作 (ViewChild) 六、组件通讯 七、生命周期 八、Rxjs 异步数据流 九、Http …

51单片机的光照强度检测【proteus仿真+程序+报告+原理图+演示视频】

1、主要功能 该系统由AT89C51/STC89C52单片机LCD1602显示模块光照传感器按键蜂鸣器LED等模块构成。适用于光照强度检测、光照强度测量报警等相似项目。 可实现功能: 1、LCD1602实时显示光照强度信息 2、光照强度传感器(电位器模拟)采集光照信息 3、可…

X86架构(九)——保护模式的进入

全局描述符表 全局描述符表(Global Descriptor Table,GDT)是保护模式下非常重要的一个数据结构。 在保护模式下,对内存的访问仍然使用段地址和偏移地址,在每个段能够访问之前,必须先行设置好 GDT 的地址,并加载全局描述符表寄存…

emp.dll丢失怎么解决,快来试试这个几个解决方法

在日常使用电脑玩游戏的过程中,我们可能会遇到一些错误提示,其中最常见的就是“emp.dll丢失”。那么,emp.dll到底是什么?它为什么会丢失?丢失后会对我们的电脑产生什么影响?本文将为您详细解析emp.dll的概念…

[BUUCTF从零单排] Web方向 03.Web入门篇之sql注入-1(手工注入详解)

这是作者新开的一个专栏《BUUCTF从零单排》,旨在从零学习CTF知识,方便更多初学者了解各种类型的安全题目,后续分享一定程度会对不同类型的题目进行总结,并结合CTF书籍和真实案例实践,希望对您有所帮助。当然&#xff0…

打造高业绩朋友圈:策略与实践

在数字化时代,朋友圈不仅是个人生活的展示窗口,更是商业变现的有力平台。许多人通过精心经营朋友圈,实现了财富的增长,甚至达到了年入百万的惊人业绩。朋友圈已成为普通人实现逆袭的重要战场。 要打造一个业绩过万的朋友圈&#…

关于武汉芯景科技有限公司的IIC电平转换芯片XJ9509开发指南(兼容PCa9509)

一、芯片引脚介绍 1.芯片引脚 2.引脚描述 二、系统结构图 三、功能描述 1.VCCA1.35V,VCCB5V,A1输入,B1输出 2.VCCA1.35V,VCCB5V,B1输入,A1输出 3.VCCA1.35V,VCCB5V,A2输入,B2输出 4.VCCA1.35V,VCCB5V,B2输入,A2输出

升级 Windows 后如何恢复丢失的文件

升级到 Windows 11 后可以恢复丢失的文件!阅读帖子直到最后,了解如何做到这一点。 为了获得安全更新并使用最新的操作系统,人们会升级到最新版本的 Windows。然而,在这样做的过程中,许多人丢失了他们的重要文件&#…

基于SpringBoot+Vue+MySQL的体育商城系统

系统展示 用户前台界面 管理员后台界面 系统背景 随着互联网的飞速发展,电子商务已成为人们日常生活中不可或缺的一部分。体育用品市场作为其中的一个重要分支,也逐渐向线上转移。基于SpringBootVueMySQL的体育商城系统应运而生,旨在通过构建…

优秀的拆分C++

题目: 样例解释: 样例1解释 6422221 是一个优秀的拆分。注意,6222 不是一个优秀的拆分,因为拆分成的 3 个数不满足每个数互不相同。 思路: 题目大致意思是说给定一个正整数NN,让你用二进制表示(…

PDCA优化任务流程

这里写目录标题 一、背景二、PDCA重要性与必要性概念PDCA循环的重要性 三、PDCA分析这次任务的执行任务描述分析原因:结合PDCA分析:提高办法: 四、总结 一、背景 汇报任务完成情况,未提交实际成果。 本次总结旨在通过PDCA循环的视…

鸿蒙开发(NEXT/API 12)【硬件(振动开发1)】振动

通过最大化开放马达器件能力,振动器模块服务拓展了原生马达服务,实现了振动与交互融合设计,从而打造出细腻精致的一体化振动体验和差异化体验,提升用户交互效率、易用性以及用户体验,并增强品牌竞争力。 运作机制 Vi…

学习docker第二弹------基本命令[帮助启动类命令、镜像命令、容器命令]

docker目录 前言基本命令帮助启动类命令停止docker服务查看docker状态启动docker重启docker开机启动docker查看概要信息查看总体帮助文档查看命令帮助文档 镜像命令查看所有的镜像 -a查看镜像ID -q在仓库里面查找redis拉取镜像查看容器/镜像/数据卷所占内存删除一个镜像删除多个…

机器学习:opencv--背景建模

目录 一、背景建模是什么? 二、背景建模的目的 三、背景建模的方法及原理 四、代码实现 1.创建卷积核 2.创建混合高斯模型 3.处理图像 4.绘制人形轮廓 5.条件退出 一、背景建模是什么? 指在计算机视觉中,从视频序列中提取出静态背景…

Anaconda虚拟环境默认路径在C盘怎么更改

笔者已经新建好了虚拟环境并且安装了对应库,输入conda env list查询发现虚拟环境竟然安装到了C盘(。•́︿•̀。),为避免下一次创建虚拟环境出错,笔者现在修改默认路径置D盘(软件安装盘) 参考两…