当前位置: 首页 > news >正文

给公司做网站要花多钱app推广的常用方法

给公司做网站要花多钱,app推广的常用方法,网站建设的宣传词,简单网页模板代码目录 安装 llama_index 搜索引擎 用 DeepSeek API 替换本地 Ollama 模型 源代码: 安装 pip install llama_index llama_index 搜索引擎 llama_index框架构建搜索引擎_llamaindex使用正则表达式拆分文档-CSDN博客 用 DeepSeek API 替换本地 Ollama 模型 https…

目录

安装

llama_index 搜索引擎

用 DeepSeek API 替换本地 Ollama 模型

源代码:


安装

 pip install llama_index

llama_index 搜索引擎

llama_index框架构建搜索引擎_llamaindex使用正则表达式拆分文档-CSDN博客

用 DeepSeek API 替换本地 Ollama 模型

https://zhuanlan.zhihu.com/p/842132629

源代码:

# %%
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader
from llama_index.vector_stores.chroma import ChromaVectorStore
from llama_index.core import StorageContext
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
from IPython.display import Markdown, displayfrom llama_index.llms.openai import OpenAI
import chromadb# %%import openai
openai.api_key = "sk"openai.api_base = "https://api.deepseek.com/v1"
llm = OpenAI(model='deepseek-chat',api_key=openai.api_key, base_url=openai.base_url)from llama_index.core import Settings# llm = OpenAI(api_key=openai.api_key, base_url=openai.base_url)
Settings.llm = OpenAI(model="deepseek-chat",api_key=openai.api_key, base_url=openai.base_url)
# %%
import osjinaai_api_key = "jina"
os.environ["JINAAI_API_KEY"] = jinaai_api_keyfrom llama_index.embeddings.jinaai import JinaEmbeddingtext_embed_model = JinaEmbedding(api_key=jinaai_api_key,model="jina-embeddings-v3",# choose `retrieval.passage` to get passage embeddingstask="retrieval.passage",
)# %%
# create client and a new collection
chroma_client = chromadb.EphemeralClient()
chroma_collection = chroma_client.create_collection("quickstart")# %%# define embedding function
embed_model = text_embed_model# load documents
documents = SimpleDirectoryReader("./data/paul_graham/").load_data()# save to diskdb = chromadb.PersistentClient(path="./chroma_db")
chroma_collection = db.get_or_create_collection("quickstart")
vector_store = ChromaVectorStore(chroma_collection=chroma_collection)
storage_context = StorageContext.from_defaults(vector_store=vector_store)index = VectorStoreIndex.from_documents(documents, storage_context=storage_context, embed_model=embed_model
)# load from disk
db2 = chromadb.PersistentClient(path="./chroma_db")
chroma_collection = db2.get_or_create_collection("quickstart")
vector_store = ChromaVectorStore(chroma_collection=chroma_collection)
index = VectorStoreIndex.from_vector_store(vector_store,embed_model=embed_model,
)# Query Data from the persisted index
query_engine = index.as_query_engine()
response = query_engine.query("What did the author do growing up?")
print('response:',response)

http://www.tj-hxxt.cn/news/98212.html

相关文章:

  • 专业建站团队百度快照怎么看
  • 网站更新维护页面系统优化软件十大排名
  • 北京网站建设套餐长沙网站搭建优化
  • 百度给做网站收费多少域名查询官网
  • 网站域名备案转接入手续南宁 百度网盘
  • 内蒙古做网站搜索引擎有哪些种类
  • 郑州建设银行网站房贷网点在哪快抖霸屏乐云seo
  • 网站开发网站说明怎么写江西百度推广开户多少钱
  • 潍坊seo网站推广苹果自研搜索引擎或为替代谷歌
  • 做网站送的手机站是什么百度搜索趋势
  • 网站可以做软著吗网络营销有哪些模式
  • 贵阳网站建设多钱钱国内免费推广产品的网站
  • 自己做个网站需要什么排名查询
  • 江阴网站推广腾讯会议开始收费
  • 盘锦市政建设集团网站营销软文100字
  • 私人怎么做彩票网站平台微信朋友圈广告在哪里做
  • 接单做公司网站站群百度seo关键词优化软件
  • 上国外网站dns推广一款app的营销方案
  • 那家b2c网站建设报价seo培训价格
  • 做阿里巴巴网站找谁搜索引擎营销是什么意思
  • 哪个网站做调查问卷赚钱国际新闻头条
  • 营销网站建设培训网站一键收录
  • 芜湖网站建设优化怎么从网上找客户
  • 专业外贸网站百度新闻官网首页
  • 手机单页网站通用模板店铺推广渠道有哪些
  • 网站设计报告播放量自助下单平台
  • 怎么做网站时时彩无限制搜索引擎排名
  • 网站木马诊断中国纪检监察报
  • 怎么做自己的发卡网站6百度数据指数
  • 基于ssm框架的购物网站开发产品怎么做推广和宣传