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.mfbz.cn/a/885153.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

银河麒麟服务器:更新软件源

银河麒麟服务器:更新软件源 1、使用场景2、操作步骤3、注意事项 💐The Begin💐点点关注,收藏不迷路💐 1、使用场景 当需要安装最新软件或修改软件源配置后,需更新软件源以获取最新软件包信息。 2、操作步…

京东PMO段敬受邀为第四届中国项目经理大会演讲嘉宾

全国项目经理专业人士年度盛会 京东集团技术委员会PMO组研发项目经理段敬女士受邀为PMO评论主办的全国项目经理专业人士年度盛会——2024第四届中国项目经理大会演讲嘉宾,演讲议题为“项目经理如何组织高效的项目会议”。大会将于10月26-27日在北京举办,…

亚信安全天穹5分钟勒索体检 免费试用今起上线

对于勒索攻击的认知 你是否还停留在“2.0时代”? 勒索攻击无疑是企业面临的最大威胁,2024年上半年,勒索组织数量同步增长超过50%,勒索攻击数量也持续攀升,平均勒索赎金突破520万美元。 当前,勒索攻击治理…

java学习-idea编辑器基础使用设置

首先打开电脑中的idea编辑器,点击头部:File按钮 → Settings… 打开设置界面; 设置idea的主题 设置idea代码注释的字体颜色 设置idea编辑器的字体和字体大小 设置idea通过提示回车自动导入包 设置idea输入忽略大小写进行提示

【Hadoop】【vim编辑器】【~/.bashrc 文件】如何编辑

1. 进入 vim 编辑器 在终端中输入以下命令: vim ~/.bashrc 2. 进入插入模式 打开文件后,你将处于普通模式。在普通模式下,你不能直接编辑文本。 要进入插入模式,请按下 i 键。这时,你应该会看到屏幕底部出现 -- 插…

fish-speech语音大模型本地部署

文章目录 fish-speech模型下载编译部署 小结 fish-speech模型 先说下fish-speech模型吧,可以先看下官网。如下: 这就是一个模型,可以根据一个样例声音,构建出自己需要的声音。其实,这个还是有很多用途的;…

多模态人像编辑:PortraitGen将2D肖像视频提升到4D 高斯场

这篇文章《Portrait Video Editing Empowered by Multimodal Generative Priors》,作者是来自中国科学技术大学。文章介绍了一种名为PortraitGen的肖像视频编辑方法,它使用多模态生成先验来实现一致性和富有表现力的风格化编辑。 文章地址:P…

匿名管道 Linux

管道 首先自己要用用户层缓冲区,还得把用户层缓冲区拷贝到管道里,(从键盘里输入数据到用户层缓冲区里面),然后用户层缓冲区通过系统调用(write)写到管道里,然后再通过read系统调用&…

[Docker学习笔记]利用Dockerfile创建镜像

Dockerfile 指令 指令作用from继承基础镜像maintainer镜像制作者信息(可缺省)run用来执行shell命令expose暴露端口号cmd启动容器默认执行的命令entrypoint启动容器真正执行的命令volume创建挂载点env配置环境变量add复制文件到容器copy复制文件到容器workdir设置容器的工作目录…

APISIX 联动雷池 WAF 实现 Web 安全防护

Apache APISIX 是一个动态、实时、高性能的云原生 API 网关,提供了负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。 雷池是由长亭科技开发的 WAF 系统,提供对 HTTP 请求的安全请求,提供完整的 API 管理和…

VUE 整合 ECharts

一、vue 引入 ECharts依赖 npm install echarts --save 二、创建盒子 <div ref"chars" style"height: 500px;width:800px;"></div> 解释说明 ref"chars" 是 Vue.js 中一个非常有用的特性&#xff0c;用于给 DOM 元素或组件实例…

二值图像的面积求取的两种方法及MATLAB实现

一、引言 面积在数字图像处理中经常用到&#xff0c;在MATLAB中&#xff0c;计算二值图像的面积通常可以通过两种主要方法实现&#xff1a;遍历法和直接利用bwarea函数。下面将分别介绍这两种方法的原理和相应的MATLAB代码示例。 二、遍历法计算二值图像面积的原理和MATLAB代码…

一条sql在MySQL中是怎么执行的

目录 一、MySQL总体架构二、各层的作用1、连接层2、应用层3、存储引擎层 一、MySQL总体架构 作为常问八股文&#xff0c;相信不少小伙伴当年都被问到过这个问题&#xff0c;回答这个问题我们首先得知道MySQL服务器基本架构&#xff0c;主要分为连接层&#xff0c;应用层和存储…

YOLOv7改进:Unified-loU,用于高品质目标检测的统一loU ,2024年8月最新IoU

💡💡💡现有IoU问题点:IoU (Intersection over Union)作为模型训练的关键,极大地显示了当前预测框与Ground Truth框之间的差异。后续研究者不断在IoU中加入更多的考虑因素,如中心距离、纵横比等。然而,仅仅提炼几何差异是有上限的;而且新的对价指数与借据本身存在潜在…

微软 Win11 RP 226x1.4247(KB5043145)预览版发布!

系统之家于9月25日发出最新报道&#xff0c;微软面向Release Preview频道的用户发布了Win11的KB5043145更新。系统更新后版本号提升为22621.4247和22631.4247。此次更新新增多项功能&#xff0c;例如用户播放媒体时&#xff0c;媒体控件会显示在锁屏中央的下部。以下跟随小编看…

easyExcel使用模版填充excel,合并单元格

一、最终效果 二、制作模版 1、制作填充模版 模版在代码中保存的位置 2、Controller /*** 下载模板*/ RequestMapping(value "exportData") public void exportData(KqKqb kqKqb,HttpServletResponse response, HttpServletRequest request) throws IOExceptio…

美团2024年秋招第一场笔试算法题题解【技术】

写一下2024年美团秋招第一场笔试算法题解&#xff0c;先贴个测评和题目链接美团2024秋招第一场笔试&#xff0c;还是比较简单的&#xff0c;前两题都是模拟&#xff0c;其中第二题涉及点思维&#xff0c;第三题笔者看到有牛友用持久化线段树和dp做的&#xff0c;但是我还不咋会…

目前最好用的爬虫软件是那个?

作为一名数据工程师&#xff0c;三天两头要采集数据&#xff0c;用过十几种爬虫软件&#xff0c;也用过Python爬虫库&#xff0c;还是建议新手使用现成的软件比较方便。 这里推荐3款不错的自动化爬虫工具&#xff0c;八爪鱼、亮数据、Web Scraper 1. 八爪鱼爬虫 八爪鱼爬虫是一…

R语言非参数回归预测摩托车事故、收入数据:局部回归、核回归、LOESS可视化...

全文链接&#xff1a;https://tecdat.cn/?p37784 非参数回归为经典&#xff08;参数&#xff09;回归方法提供了一种灵活的替代方法。与假定回归关系具有依赖于有限数量的未知参数的已知形式的传统&#xff08;参数&#xff09;方法不同&#xff0c;非参数回归模型尝试从数据样…

java后端项目技术记录

后端使用技术记录 一、软件1. apifox&#xff0c;API管理软件问题 2. nginx前端服务器(1) 反向代理(2) 负载均衡 二、问题1. 使用spring全局异常处理器处理特定的异常2. 扩展springmvc的消息转换器&#xff08;对象和json数据的转换&#xff09;3. 路径参数的接收4. 实体构建器…