公司做网站需要服务器吗辰景青岛网站建设

bicheng/2026/1/19 16:22:18/文章来源:
公司做网站需要服务器吗,辰景青岛网站建设,解释自己做的网站,网红网站建设LlamaIndex 是一个数据框架#xff0c;供 LLM 应用程序摄取、构建和访问私有或特定领域的数据。 LlamaIndex 是开源的#xff0c;可用于构建各种应用程序。 在 GitHub 上查看该项目。 安装 在 Docker 上设置 Elasticsearch 使用以下 docker 命令启动单节点 Elasticsearch 实…LlamaIndex 是一个数据框架供 LLM 应用程序摄取、构建和访问私有或特定领域的数据。 LlamaIndex 是开源的可用于构建各种应用程序。 在 GitHub 上查看该项目。 安装 在 Docker 上设置 Elasticsearch 使用以下 docker 命令启动单节点 Elasticsearch 实例。我们可以参考之前的文章 “Elasticsearch如何在 Docker 上运行 Elasticsearch 8.x 进行本地开发”。我选择不使用安全配置。直接使用 docker compose 来启动 Elasticsearch 及 Kibana .env $ pwd /Users/liuxg/data/docker8 $ ls -al total 16 drwxr-xr-x 4 liuxg staff 128 Jan 16 13:00 . drwxr-xr-x 193 liuxg staff 6176 Jan 12 08:31 .. -rw-r--r-- 1 liuxg staff 21 Jan 16 13:00 .env -rw-r--r-- 1 liuxg staff 733 Mar 14 2023 docker-compose.yml $ cat .env STACK_VERSION8.11.3 docker-compose.yml version: 3.9 services:elasticsearch:image: elasticsearch:${STACK_VERSION}container_name: elasticsearchenvironment:- discovery.typesingle-node- ES_JAVA_OPTS-Xms1g -Xmx1g- xpack.security.enabledfalsevolumes:- type: volumesource: es_datatarget: /usr/share/elasticsearch/dataports:- target: 9200published: 9200networks:- elastickibana:image: kibana:${STACK_VERSION}container_name: kibanaports:- target: 5601published: 5601depends_on:- elasticsearchnetworks:- elastic volumes:es_data:driver: localnetworks:elastic:name: elasticdriver: bridge 我们使用如下的命令来启动 docker-compose up ​ 这样我们就完成了 Elasticsearch 及 Kibana 的安装了。我们的 Elasticsearch 及 Kibana 都没有安全的设置。这个在生产环境中不被推荐使用。 应用设计 -  组装管道 我们将使用 Jupyter notebook 来进行设计。我们在命令行中打入: jupyter notebook 安装依赖 我们使用如下的命令来安装 Python 的依赖包 pip3 install llama-index openai elasticsearch load_dotenv 我们接下来在当前的工作目录中创建一个叫做 .env 的文件 .env OPENAI_API_KEYYourOpenAIKey 请在 .env 中创建如上所示的变量。你需要把自己的 openai key 写入到上面的文件里。 加载模块及读取环境变量 import logging import sys import os from dotenv import load_dotenvload_dotenv()logging.basicConfig(streamsys.stdout, levellogging.INFO) logging.getLogger().addHandler(logging.StreamHandler(streamsys.stdout))os.environ[OPENAI_API_KEY] os.getenv(OPENAI_API_KEY)import openai 连接到 Elasticsearch ElasticsearchStore 类用于连接到 Elasticsearch 实例。 它需要以下参数 index_nameElasticsearch 索引的名称。 必需的。es_client可选。 预先存在的 Elasticsearch 客户端。es_url可选。Elasticsearch 网址。es_cloud_id可选。 Elasticsearch 云 ID。es_api_key可选。 Elasticsearch API 密钥。es_user可选。 Elasticsearch 用户名。es_password可选。 弹性搜索密码。text_field可选。 存储文本的 Elasticsearch 字段的名称。vector_field可选。 存储 Elasticsearch 字段的名称嵌入。batch_size可选。 批量索引的批量大小。 默认为 200。distance_strategy可选。 用于相似性搜索的距离策略。默认为 “COSINE”。 针对我们的情况我们可以使用如下的示例方法来进行本地连接 from llama_index.vector_stores import ElasticsearchStorees ElasticsearchStore(index_namemy_index,es_urlhttp://localhost:9200, ) 我们将在下面的代码中使用上述的方法来连接 Elasticsearch。 加载文档使用 Elasticsearch 构建 VectorStoreIndex from llama_index import VectorStoreIndex, SimpleDirectoryReader from llama_index.vector_stores import ElasticsearchStore!mkdir -p data/paul_graham/ !wget https://raw.githubusercontent.com/run-llama/llama_index/main/docs/examples/data/paul_graham/paul_graham_essay.txt -O data/paul_graham/paul_graham_essay.txt 运行完上面的命令后我们可以在当前的目录下查看 $ pwd /Users/liuxg/python/elser $ ls data/paul_graham/ paul_graham_essay.txt 我们可以看到一个叫做 pau_graham_essay.txt 的文件。它的内容如下 What I Worked OnFebruary 2021Before college the two main things I worked on, outside of school, were writing and programming. I didnt write essays. I wrote what beginning writers were supposed to write then, and probably still are: short stories. My stories were awful. They had hardly any plot, just characters with strong feelings, which I imagined made them deep.The first programs I tried writing were on the IBM 1401 that our school district used for what was then called data processing. This was in 9th grade, so I was 13 or 14. The school districts 1401 happened to be in the basement of our junior high school, and my friend Rich Draves and I got permission to use it. It was like a mini Bond villains lair down there, with all these alien-looking machines — CPU, disk drives, printer, card reader — sitting up on a raised floor under bright fluorescent lights....The language we used was an early version of Fortran. You had to type programs on punch cards, then stack them in the card reader and press a button to load the program into memory and run it. The result would ordinarily be to print something on the spectacularly loud printer.I was puzzled by the 1401. I couldnt figure out what to do with it. And in retrospect theres not much I could have done with it. The only form of input to programs was data stored on punched cards, and I didnt have any data stored on punched cards. The only other option was to do things that didnt rely on any input, like calculate approximations of pi, but I didnt know enough math to do anything interesting of that type. So Im not surprised I cant remember any programs I wrote, because they cant have done much. My clearest memory is of the moment I learned it was possible for programs not to terminate, when one of mine didnt. On a machine without time-sharing, this was a social as well as a technical error, as the data center managers expression made clear. ...Toward the end of the summer I got a big surprise: a letter from the Accademia, which had been delayed because theyd sent it to Cambridge England instead of Cambridge Massachusetts, inviting me to take the entrance exam in Florence that fall. This was now only weeks away. My nice landlady let me leave my stuff in her attic. I had some money saved from consulting work Id done in grad school; there was probably enough to last a year if I lived cheaply. Now all I had to do was learn Italian. ... documents SimpleDirectoryReader(./data/paul_graham/).load_data()from llama_index.storage.storage_context import StorageContextvector_store ElasticsearchStore(es_urlhttp://localhost:9200,# Or with Elastic Cloud# es_cloud_idmy_cloud_id,# es_userelastic,# es_passwordmy_password,index_namepaul_graham, )storage_context StorageContext.from_defaults(vector_storevector_store) index VectorStoreIndex.from_documents(documents, storage_contextstorage_context ) 基本查询 我们将向查询引擎询问有关我们刚刚索引的数据的问题。 # set Logging to DEBUG for more detailed outputs query_engine index.as_query_engine() response query_engine.query(what were his investments in Y Combinator?) print(response) 元数据过滤器 在这里我们将使用元数据索引一些文档以便我们可以将过滤器应用于查询引擎。 from llama_index.schema import TextNodenodes [TextNode(textThe Shawshank Redemption,metadata{author: Stephen King,theme: Friendship,},),TextNode(textThe Godfather,metadata{director: Francis Ford Coppola,theme: Mafia,},),TextNode(textBeautiful weather,metadata{director: Mark shuttle,theme: Mafia,},), TextNode(textInception,metadata{director: Christopher Nolan,},), ]# initialize the vector store vector_store_metadata_example ElasticsearchStore(index_namemovies_metadata_example,es_urlhttp://localhost:9200, ) storage_context StorageContext.from_defaults(vector_storevector_store_metadata_example ) index1 VectorStoreIndex(nodes, storage_contextstorage_context)# Metadata filter from llama_index.vector_stores.types import ExactMatchFilter, MetadataFiltersfilters MetadataFilters(filters[ExactMatchFilter(keytheme, valueMafia)] )retriever index1.as_retriever(filtersfilters)retriever.retrieve(weather is so beautiful) 在上面我们搜索的是 “weather is so beautiful”从而在两个 theme 为 Mafia 的 Texnode 里Mark shuttle 位列第一。这个是因为 “weather is so beautiful” 更和 “Beautiful weather” 更为贴近。 如果我们使用如下的查询 retriever.retrieve(The godfather is a nice person) 很显然这次我们的搜索结果的排序颠倒过来了。 自定义过滤器和覆盖查询 llama-index 目前仅支持 ExactMatchFilters。 Elasticsearch 支持多种过滤器包括范围过滤器、地理过滤器等。 要使用这些过滤器你可以将它们作为字典列表传递给 es_filter 参数。 def custom_query(query, query_str):print(custom query, query)return queryquery_engine index.as_query_engine(vector_store_kwargs{es_filter: [{match: {content: growing up}}],custom_query: custom_query,} )response query_engine.query(what were his investments in Y Combinator?) print(response) 为了方便大家学习我把所有的源码放到 githubhttps://github.com/liu-xiao-guo/semantic_search_es。其中相关的文件是 https://github.com/liu-xiao-guo/semantic_search_es/blob/main/Elasticsearch%20integration%20-%20LIamaIndex%20.ipynb 更多阅读使用 Elasticsearch 和 LlamaIndex 进行高级文本检索句子窗口检索

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

网站设计模版搜索引擎营销原理是什么

概述 UDP (User Datagram Protocol)是一种简单的传输层协议。与TCP不同,UDP不提供可靠的数据传输和错误检测机制。UDP主要用于那些对实时性要求较高、对数据传输可靠性要求较低的应用,如音频、视频、实时游戏等。 UDP使用无连接的数据报传输模式。在传…

校园招聘哪个网站做的好电子商务网站建设名词解释

Python接口自动化测试在软件质量保证方面具有显著的优势,如提高测试效率、减少人工错误、支持持续集成和回归测试等。然而,它也存在一些局限性,主要包括以下几点: 1. **初始投入成本高**: - 编写自动化测试脚本需要…

厦门高端网站建设定制备案的域名做电影网站吗

System.arraycopy()这是一个由java标准库提供的方法。用它进行复制数组比用for循环要快的多。arraycopy()需要的参数有:源数组,从源数组中的什么位置开始复制的偏移量,目标数组,从目标数组中的什么位置开始复制的偏移量&#xff0…

企业站网站网站开发服务器的选择

第四届管理科学和软件工程国际学术会议(ICMSSE 2024)由ACM珠海分会,广州番禺职业技术学院主办;全国区块链行业产教融合共同体,AEIC学术交流中心承办,将于2024年7月19-21日于广州召开。 会议旨在为从事管理与软件工程领域的专家学…

xml是用来做网站的嘛ps做图 游戏下载网站有哪些内容

目录 Oracle之 第三篇 PL/SQL基础 PL/SQL程序块 PL/SQL语言 PL/SQL的基本结构 PL/SQL块分类 一、PL/SQL语言 二、PL/SQL 常量 、变量 合法字符 数据类型 LOB 数据类型 属性类型 运算符 常量 PL/SQL常量 1 、变量的声明 2、属性类型 % type 变量赋值 %type…

自己怎么建个优惠网站给人做网站的公司

反向动力学(Inverse Kinematic,简称IK)是一种通过子节点带动父节点运动的方法。 正向动力学 在骨骼动画中,大多数动画是通过将骨架中的关节角度旋转到预定值来生成的,子关节的位置根据父关节的旋转而改变,这…

建设网站app想找工作去哪个网站

文章目录 一. 概述二. 维度数据模型建模过程三. 维度规范化四. 维度数据模型的特点五. 维度数据模型1. 星型模式1.1.事实表1.2.维度表1.3.优点1.4.缺点1.5.示例 2. 雪花模式2.1.数据规范化与存储2.2&#x…

微网站生成app网站服务器商

目录 一、基础操作 1、通过属性名等方式 2、通过属性组合 3、子节点方式 4、子节点加属性组合方式 5、孙节点offspring 6、兄弟节点sibling 7、父节点parent 8、正则表达式 9、直到某个元素出现 10、直到某个元素消失 二、通过局部坐标定位 1、使用局部坐标系的cli…

网站上的html内容怎么修改网站建设 会计分录

🚀🚀🚀本文改进:Focaler-IoU更加聚焦的IoU损失Focaler-IoU,能够在不同的检测任务中聚焦不同的回归样本,使用线性区间映射的方法来重构IoU损失 🚀🚀🚀RT-DETR改进创新专栏:http://t.csdnimg.cn/vuQTz 🚀🚀🚀学姐带你学习YOLOv8,从入门到创新,轻轻松松搞…

网站配置服务Wordpress北京文化墙设计公司

一、性能轮盘赌 机器码相同,但放置在不同的地址上,性能可能截然不同。 作为软件开发人员,我们经常假设特定代码的性能仅由代码本身和运行它的硬件决定。这种假设让我们在优化代码以获得更好性能时感到有控制力。虽然在大多数情况下这种假设…

衡阳市做淘宝网站建设俄罗斯ip地址

Mac M2芯片配置PHP环境 1. XAMPP2. PHPBrew(PHP版本管理)安装php7.4.33版本 3. 直接使用homebrew 安装php环境参考 1. XAMPP 官网地址 https://www.apachefriends.org/ 安装 安装完成 web server打开后,在打开localhost 成功! 2. PHPBrew(PHP版本管…

浙江网站建设专家评价网站做子站点有什么用

目录 分治快排算法原理 力扣75. 颜色分类 解析代码 分治快排算法原理 分治就是分而治之,快排在数据结构也学过了,现在来学一学三路划分快排(数组划分三块): 前面我们已经实现了三个版本的快速排序的算法&#xff0…

城乡建设学校官方网站城阳网站建设哪家好

接线图: #include "stm32f10x.h" // Device header//1: 开启RCC时钟,包括ADC和GPIO的时钟//2:配置GPIO将GPIO配置为模拟输入模式//3:配置多路开关将左边的通道接入到规则组中//4:配置ADC转…

公司为什么要网站备案wordpress文章顺序

目录 一、题目 描述 输入描述&#xff1a; 输出描述&#xff1a; 示例1 二、结论 三、代码 四、讲解 五、注意点&#xff1a; 一、题目 描述 输入M、N&#xff0c;1 < M < N < 1000000&#xff0c;求区间[M,N]内的所有素数的个数。素数定义&#xff1a;除了1以…

公司优化网站的案例做网站用哪个编程语言

纽扣电池由于体积小&#xff0c;容易被小孩吞入&#xff0c;因此各国对安装在带电产品上面的纽扣电池都有要求。 2023年9月美国消费品安全委员会&#xff08;CPSC&#xff09;发出最终法规文件&#xff0c;决定采用UL4200A:2023作为含纽扣强制安全标准&#xff0c;同时编入16C…

网站首页广告代码制作一个网站的全过程

plasmo&#xff1a;GitHub - PlasmoHQ/plasmo: &#x1f9e9; The Browser Extension Framework plasmo是一个开发浏览器插件的框架&#xff0c;支持使用react和vue等技术&#xff0c;而且不用手动管理manifest.json文件&#xff0c;框架会根据你在框架中的使用&#xff0c;自…

公司公众网站微信平台建设方案网站的建设项目是什么

一、概述 最近几天公司项目开发上线完成&#xff0c;做个收获总结吧~ 今天记录Redis的收获和提升。 二、Redis异步队列 Redis做异步队列一般使用 list 结构作为队列&#xff0c;rpush 生产消息&#xff0c;lpop 消费消息。当 lpop 没有消息的时候&#xff0c;要适当sleep再…

网站怎么做404页面跳转网页制作q元素

一篇论文回顾 Sora 文生视频技术的背景、技术和应用。 追赶 Sora&#xff0c;成为了很多科技公司当下阶段的新目标。研究者们好奇的是&#xff1a;Sora 是如何被 OpenAI 发掘出来的&#xff1f;未来又有哪些演进和应用方向&#xff1f; Sora 的技术报告披露了一些技术细节&…

苏州高端网站建设门户网站怎么做才好看

一、引言 美国大学生数学建模竞赛&#xff08;MCM/ICM&#xff0c;通常被称为“美赛”&#xff09;是全球范围内最具影响力和挑战性的大学生数学建模竞赛之一。参与美赛不仅能锻炼大学生的数学建模、问题分析、团队协作和英文写作能力&#xff0c;还能为他们未来的学术和职业生…

如何将自己做的网站推广出去网站建设高度

大家是否会遇到需要勾中选项的情况&#xff0c;我们可以在电子表格中制作出可以勾选、选中的选项按钮&#xff0c;今天我们一起学习一下设置方法。 首先&#xff0c;我们需要先在excel工具栏中添加一个功能模块&#xff1a;开发工具 依次点击excel中的文件 – 选项 – 自定义…