@ -0,0 +1,8 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="D:\anaconda3\envs\py310" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PyDocumentationSettings">
|
||||
<option name="format" value="GOOGLE" />
|
||||
<option name="myDocStringFormat" value="Google" />
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="D:\anaconda3\envs\lightrag" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="D:\anaconda3\envs\py310" project-jdk-type="Python SDK" />
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/dsLightRag.iml" filepath="$PROJECT_DIR$/.idea/dsLightRag.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PrettierConfiguration">
|
||||
<option name="myConfigurationMode" value="AUTOMATIC" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,21 @@
|
||||
# 大模型 【DeepSeek深度求索官方】
|
||||
#LLM_API_KEY = "sk-44ae895eeb614aa1a9c6460579e322f1"
|
||||
#LLM_BASE_URL = "https://api.deepseek.com"
|
||||
#LLM_MODEL_NAME = "deepseek-chat"
|
||||
|
||||
# 阿里云提供的大模型服务
|
||||
LLM_API_KEY="sk-f6da0c787eff4b0389e4ad03a35a911f"
|
||||
LLM_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1"
|
||||
#LLM_MODEL_NAME = "qwen-plus" # 不要使用通义千问,会导致化学方程式不正确!
|
||||
LLM_MODEL_NAME = "deepseek-v3"
|
||||
|
||||
EMBED_MODEL_NAME = "BAAI/bge-m3"
|
||||
EMBED_API_KEY = "sk-pbqibyjwhrgmnlsmdygplahextfaclgnedetybccknxojlyl"
|
||||
EMBED_BASE_URL = "https://api.siliconflow.cn/v1"
|
||||
EMBED_DIM = 1024
|
||||
EMBED_MAX_TOKEN_SIZE = 8192
|
||||
|
||||
|
||||
NEO4J_URI = "bolt://localhost:7687"
|
||||
NEO4J_USERNAME = "neo4j"
|
||||
NEO4J_PASSWORD = "DsideaL147258369"
|
After Width: | Height: | Size: 76 KiB |
@ -0,0 +1,30 @@
|
||||
# 添加Anaconda的TUNA镜像
|
||||
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
|
||||
|
||||
# 设置搜索时显示通道地址
|
||||
conda config --set show_channel_urls yes
|
||||
|
||||
# 创建虚拟环境
|
||||
conda create -n rag python=3.10
|
||||
|
||||
# 查看当前存在哪些虚拟环境
|
||||
conda env list
|
||||
conda info -e
|
||||
|
||||
# 查看安装了哪些包
|
||||
conda list
|
||||
|
||||
# 激活虚拟环境
|
||||
conda activate rag
|
||||
|
||||
# 对虚拟环境中安装额外的包
|
||||
conda install -n rag $package_name
|
||||
|
||||
# 删除虚拟环境
|
||||
conda remove -n rag --all
|
||||
|
||||
# 删除环境中的某个包
|
||||
conda remove --name rag $package_name
|
||||
|
||||
# 恢复默认镜像
|
||||
conda config --remove-key channels
|
@ -0,0 +1,5 @@
|
||||
https://github.com/jgm/pandoc/releases/tag/3.7.0.2
|
||||
https://objects.githubusercontent.com/github-production-release-asset-2e65be/571770/92882bf5-3b76-4345-b08a-9d9badc74957?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250626%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250626T231242Z&X-Amz-Expires=1800&X-Amz-Signature=55493529bc6e5a3779e95bcdd9f33cf09477d3e47f9a441b9412b5b193d788db&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dpandoc-3.7.0.2-windows-x86_64.msi&response-content-type=application%2Foctet-stream
|
||||
|
||||
|
||||
pandoc -f docx -t markdown -o c:/aaa.md D:\dsWork\dsProject\dsRag\static\Txt\化学方程式_CHEMISTRY_1.docx
|
@ -0,0 +1,25 @@
|
||||
#### 一、官网
|
||||
```cmd
|
||||
https://github.com/HKUDS/LightRAG
|
||||
```
|
||||
|
||||
#### 二、环境配置
|
||||
|
||||
```cmd
|
||||
# 删除虚拟环境
|
||||
conda remove -n py310 --all
|
||||
|
||||
# 创建虚拟环境
|
||||
conda create -n py310 python=3.10
|
||||
|
||||
# 查看当前存在哪些虚拟环境
|
||||
conda env list
|
||||
|
||||
# 激活虚拟环境
|
||||
conda activate py310
|
||||
|
||||
# 安装lightrag
|
||||
pip install "lightrag-hku[api]"
|
||||
```
|
||||
|
||||
####
|
@ -0,0 +1,48 @@
|
||||
import asyncio
|
||||
|
||||
from Util.DocxUtil import get_docx_content_by_pandoc
|
||||
from Util.LightRagUtil import configure_logging, initialize_rag
|
||||
import os
|
||||
|
||||
# 数学
|
||||
KEMU = 'Chemistry' # Chinese,Math,Chemistry
|
||||
|
||||
# 组装文件路径
|
||||
WORKING_DIR = "./Topic/" + KEMU
|
||||
docx_file = 'static/Txt/' + KEMU + '.docx'
|
||||
|
||||
async def main():
|
||||
# 注释掉或删除以下清理代码
|
||||
files_to_delete = [
|
||||
"graph_chunk_entity_relation.graphml",
|
||||
"kv_store_doc_status.json",
|
||||
"kv_store_full_docs.json",
|
||||
"kv_store_text_chunks.json",
|
||||
"vdb_chunks.json",
|
||||
"vdb_entities.json",
|
||||
"vdb_relationships.json",
|
||||
]
|
||||
|
||||
# 获取docx文件的内容
|
||||
content = get_docx_content_by_pandoc(docx_file)
|
||||
|
||||
# 删除文件
|
||||
for file in files_to_delete:
|
||||
file_path = os.path.join(WORKING_DIR, file)
|
||||
if os.path.exists(file_path):
|
||||
os.remove(file_path)
|
||||
print(f"Deleting old file:: {file_path}")
|
||||
|
||||
try:
|
||||
rag = await initialize_rag(WORKING_DIR)
|
||||
await rag.ainsert(content)
|
||||
print("\nIndexing completed successfully!")
|
||||
except Exception as e:
|
||||
print(f"An error occurred: {e}")
|
||||
finally:
|
||||
await rag.finalize_storages()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
configure_logging()
|
||||
asyncio.run(main())
|
@ -0,0 +1,129 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
|
||||
<key id="d11" for="edge" attr.name="created_at" attr.type="long" />
|
||||
<key id="d10" for="edge" attr.name="file_path" attr.type="string" />
|
||||
<key id="d9" for="edge" attr.name="source_id" attr.type="string" />
|
||||
<key id="d8" for="edge" attr.name="keywords" attr.type="string" />
|
||||
<key id="d7" for="edge" attr.name="description" attr.type="string" />
|
||||
<key id="d6" for="edge" attr.name="weight" attr.type="double" />
|
||||
<key id="d5" for="node" attr.name="created_at" attr.type="long" />
|
||||
<key id="d4" for="node" attr.name="file_path" attr.type="string" />
|
||||
<key id="d3" for="node" attr.name="source_id" attr.type="string" />
|
||||
<key id="d2" for="node" attr.name="description" attr.type="string" />
|
||||
<key id="d1" for="node" attr.name="entity_type" attr.type="string" />
|
||||
<key id="d0" for="node" attr.name="entity_id" attr.type="string" />
|
||||
<graph edgedefault="undirected">
|
||||
<node id="硝酸光照分解的方程式">
|
||||
<data key="d0">硝酸光照分解的方程式</data>
|
||||
<data key="d1">event</data>
|
||||
<data key="d2">The equation describes the photodecomposition of nitric acid under light, producing nitrogen dioxide, oxygen, and water.</data>
|
||||
<data key="d3">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d4">unknown_source</data>
|
||||
<data key="d5">1752050398</data>
|
||||
</node>
|
||||
<node id="氢气与氧气燃烧的现象">
|
||||
<data key="d0">氢气与氧气燃烧的现象</data>
|
||||
<data key="d1">event</data>
|
||||
<data key="d2">The phenomenon describes the combustion of hydrogen and oxygen, as illustrated in the provided image.</data>
|
||||
<data key="d3">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d4">unknown_source</data>
|
||||
<data key="d5">1752050398</data>
|
||||
</node>
|
||||
<node id="硝酸">
|
||||
<data key="d0">硝酸</data>
|
||||
<data key="d1">category</data>
|
||||
<data key="d2">Nitric acid (HNO₃) is a highly corrosive mineral acid involved in the photodecomposition reaction.</data>
|
||||
<data key="d3">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d4">unknown_source</data>
|
||||
<data key="d5">1752050398</data>
|
||||
</node>
|
||||
<node id="氮氧化物">
|
||||
<data key="d0">氮氧化物</data>
|
||||
<data key="d1">category</data>
|
||||
<data key="d2">Nitrogen dioxide (NO₂) is a product of nitric acid decomposition, appearing as a reddish-brown gas.</data>
|
||||
<data key="d3">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d4">unknown_source</data>
|
||||
<data key="d5">1752050398</data>
|
||||
</node>
|
||||
<node id="氧气">
|
||||
<data key="d0">氧气</data>
|
||||
<data key="d1">category</data>
|
||||
<data key="d2">Oxygen (O₂) is produced as a byproduct in nitric acid decomposition and is essential for combustion.</data>
|
||||
<data key="d3">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d4">unknown_source</data>
|
||||
<data key="d5">1752050398</data>
|
||||
</node>
|
||||
<node id="水">
|
||||
<data key="d0">水</data>
|
||||
<data key="d1">category</data>
|
||||
<data key="d2">Water (H₂O) is formed in the photodecomposition of nitric acid.</data>
|
||||
<data key="d3">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d4">unknown_source</data>
|
||||
<data key="d5">1752050398</data>
|
||||
</node>
|
||||
<node id="氢气">
|
||||
<data key="d0">氢气</data>
|
||||
<data key="d1">category</data>
|
||||
<data key="d2">Hydrogen (H₂) is involved in the combustion reaction with oxygen, producing water.</data>
|
||||
<data key="d3">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d4">unknown_source</data>
|
||||
<data key="d5">1752050398</data>
|
||||
</node>
|
||||
<node id="光照">
|
||||
<data key="d0">光照</data>
|
||||
<data key="d1">event</data>
|
||||
<data key="d2">Light acts as a catalyst in the decomposition of nitric acid.</data>
|
||||
<data key="d3">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d4">unknown_source</data>
|
||||
<data key="d5">1752050398</data>
|
||||
</node>
|
||||
<node id="燃烧">
|
||||
<data key="d0">燃烧</data>
|
||||
<data key="d1">event</data>
|
||||
<data key="d2">Combustion refers to the rapid chemical reaction between hydrogen and oxygen, releasing energy.</data>
|
||||
<data key="d3">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d4">unknown_source</data>
|
||||
<data key="d5">1752050398</data>
|
||||
</node>
|
||||
<edge source="硝酸" target="光照">
|
||||
<data key="d6">9.0</data>
|
||||
<data key="d7">Nitric acid decomposes under light, producing nitrogen dioxide, oxygen, and water.</data>
|
||||
<data key="d8">decomposition,photochemical reaction</data>
|
||||
<data key="d9">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d10">unknown_source</data>
|
||||
<data key="d11">1752050398</data>
|
||||
</edge>
|
||||
<edge source="硝酸" target="氮氧化物">
|
||||
<data key="d6">8.0</data>
|
||||
<data key="d7">Nitrogen dioxide is a direct product of nitric acid decomposition.</data>
|
||||
<data key="d8">chemical product,reaction outcome</data>
|
||||
<data key="d9">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d10">unknown_source</data>
|
||||
<data key="d11">1752050398</data>
|
||||
</edge>
|
||||
<edge source="硝酸" target="氧气">
|
||||
<data key="d6">7.0</data>
|
||||
<data key="d7">Oxygen is released as a byproduct during nitric acid decomposition.</data>
|
||||
<data key="d8">gas evolution,reaction byproduct</data>
|
||||
<data key="d9">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d10">unknown_source</data>
|
||||
<data key="d11">1752050398</data>
|
||||
</edge>
|
||||
<edge source="硝酸" target="水">
|
||||
<data key="d6">7.0</data>
|
||||
<data key="d7">Water is formed as a result of nitric acid photodecomposition.</data>
|
||||
<data key="d8">chemical synthesis,reaction product</data>
|
||||
<data key="d9">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d10">unknown_source</data>
|
||||
<data key="d11">1752050398</data>
|
||||
</edge>
|
||||
<edge source="氧气" target="氢气">
|
||||
<data key="d6">10.0</data>
|
||||
<data key="d7">Hydrogen combusts with oxygen, producing water and energy.</data>
|
||||
<data key="d8">combustion,exothermic reaction</data>
|
||||
<data key="d9">chunk-19ff3bd9fb2635b72b0d70f58e920f97</data>
|
||||
<data key="d10">unknown_source</data>
|
||||
<data key="d11">1752050398</data>
|
||||
</edge>
|
||||
</graph>
|
||||
</graphml>
|
@ -0,0 +1,52 @@
|
||||
import os
|
||||
import subprocess
|
||||
import uuid
|
||||
|
||||
|
||||
def get_docx_content_by_pandoc(docx_file):
|
||||
# 最后拼接的内容
|
||||
content = ""
|
||||
# output_file 设置为临时目录下的uuid.md
|
||||
file_name = uuid.uuid4().hex
|
||||
# 将docx_file去掉扩展名
|
||||
prefix = docx_file.split(".")[0].split("/")[-1]
|
||||
temp_markdown = os.path.join('./static/markdown/', prefix + '.md')
|
||||
# 调用pandoc将docx文件转换成markdown
|
||||
os.mkdir("./static/Images/" + file_name)
|
||||
subprocess.run(['pandoc', docx_file, '-f', 'docx', '-t', 'markdown', '-o', temp_markdown,
|
||||
'--extract-media=./static/Images/' + file_name])
|
||||
# 读取然后修改内容,输出到新的文件
|
||||
img_idx = 0 # 图片索引
|
||||
with open(temp_markdown, 'r', encoding='utf-8') as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
# 跳过图片高度描述行
|
||||
if line.startswith('height=') and line.endswith('in"}'):
|
||||
continue
|
||||
# 使用find()方法安全地检查图片模式
|
||||
is_img = line.find(" >= 0 and (
|
||||
line.find(".png") > 0 or
|
||||
line.find(".jpg") > 0 or
|
||||
line.find(".jpeg") > 0
|
||||
)
|
||||
if is_img:
|
||||
# {width="3.1251607611548557in"
|
||||
# height="3.694634733158355in"}
|
||||
# {width="3.1251607611548557in"
|
||||
pos = line.find(")")
|
||||
q = line[:pos + 1]
|
||||
q=q.replace("./static",".")
|
||||
#q = q[4:-1]
|
||||
#q='<img src="'+q+'" alt="我是图片">'
|
||||
img_idx += 1
|
||||
content += q + "\n"
|
||||
else:
|
||||
content += line.strip().replace("**", "") + "\n"
|
||||
# 将content回写到markdown文件
|
||||
with open(temp_markdown, 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
# 删除临时文件 output_file
|
||||
# os.remove(temp_markdown)
|
||||
return content.replace("\n\n", "\n").replace("\\", "")
|
@ -0,0 +1,142 @@
|
||||
import logging
|
||||
import logging.config
|
||||
import os
|
||||
|
||||
import numpy as np
|
||||
|
||||
from lightrag import LightRAG
|
||||
from lightrag.kg.shared_storage import initialize_pipeline_status
|
||||
from lightrag.llm.openai import openai_complete_if_cache, openai_embed
|
||||
from lightrag.utils import EmbeddingFunc, logger, set_verbose_debug
|
||||
from Config.Config import *
|
||||
|
||||
|
||||
async def print_stream(stream):
|
||||
async for chunk in stream:
|
||||
if chunk:
|
||||
print(chunk, end="", flush=True)
|
||||
|
||||
|
||||
def configure_logging():
|
||||
for logger_name in ["uvicorn", "uvicorn.access", "uvicorn.error", "lightrag"]:
|
||||
logger_instance = logging.getLogger(logger_name)
|
||||
logger_instance.handlers = []
|
||||
logger_instance.filters = []
|
||||
|
||||
log_dir = os.getenv("LOG_DIR", os.getcwd())
|
||||
log_file_path = os.path.abspath(
|
||||
os.path.join(log_dir, "./Logs/lightrag.log")
|
||||
)
|
||||
|
||||
print(f"\nLightRAG log file: {log_file_path}\n")
|
||||
os.makedirs(os.path.dirname(log_dir), exist_ok=True)
|
||||
|
||||
log_max_bytes = int(os.getenv("LOG_MAX_BYTES", 10485760))
|
||||
log_backup_count = int(os.getenv("LOG_BACKUP_COUNT", 5))
|
||||
|
||||
logging.config.dictConfig(
|
||||
{
|
||||
"version": 1,
|
||||
"disable_existing_loggers": False,
|
||||
"formatters": {
|
||||
"default": {
|
||||
"format": "%(levelname)s: %(message)s",
|
||||
},
|
||||
"detailed": {
|
||||
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
||||
},
|
||||
},
|
||||
"handlers": {
|
||||
"console": {
|
||||
"formatter": "default",
|
||||
"class": "logging.StreamHandler",
|
||||
"stream": "ext://sys.stderr",
|
||||
},
|
||||
"file": {
|
||||
"formatter": "detailed",
|
||||
"class": "logging.handlers.RotatingFileHandler",
|
||||
"filename": log_file_path,
|
||||
"maxBytes": log_max_bytes,
|
||||
"backupCount": log_backup_count,
|
||||
"encoding": "utf-8",
|
||||
},
|
||||
},
|
||||
"loggers": {
|
||||
"lightrag": {
|
||||
"handlers": ["console", "file"],
|
||||
"level": "INFO",
|
||||
"propagate": False,
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
logger.setLevel(logging.INFO)
|
||||
set_verbose_debug(os.getenv("VERBOSE_DEBUG", "false").lower() == "true")
|
||||
|
||||
|
||||
async def llm_model_func(
|
||||
prompt, system_prompt=None, history_messages=None, **kwargs
|
||||
) -> str:
|
||||
return await openai_complete_if_cache(
|
||||
os.getenv("LLM_MODEL", LLM_MODEL_NAME),
|
||||
prompt,
|
||||
system_prompt=system_prompt,
|
||||
history_messages=history_messages,
|
||||
api_key=LLM_API_KEY,
|
||||
base_url=LLM_BASE_URL,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
|
||||
async def embedding_func(texts: list[str]) -> np.ndarray:
|
||||
return await openai_embed(
|
||||
texts,
|
||||
model=EMBED_MODEL_NAME,
|
||||
api_key=EMBED_API_KEY,
|
||||
base_url=EMBED_BASE_URL
|
||||
)
|
||||
|
||||
|
||||
async def initialize_rag(working_dir):
|
||||
rag = LightRAG(
|
||||
working_dir=working_dir,
|
||||
llm_model_func=llm_model_func,
|
||||
embedding_func=EmbeddingFunc(
|
||||
embedding_dim=EMBED_DIM,
|
||||
max_token_size=EMBED_MAX_TOKEN_SIZE,
|
||||
func=embedding_func
|
||||
),
|
||||
)
|
||||
|
||||
await rag.initialize_storages()
|
||||
await initialize_pipeline_status()
|
||||
|
||||
return rag
|
||||
|
||||
|
||||
def create_llm_model_func():
|
||||
def llm_model_func(prompt, system_prompt=None, history_messages=[], **kwargs):
|
||||
return openai_complete_if_cache(
|
||||
LLM_MODEL_NAME,
|
||||
prompt,
|
||||
system_prompt=system_prompt,
|
||||
history_messages=history_messages,
|
||||
api_key=LLM_API_KEY,
|
||||
base_url=LLM_BASE_URL,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return llm_model_func
|
||||
|
||||
|
||||
def create_embedding_func():
|
||||
return EmbeddingFunc(
|
||||
embedding_dim=1024,
|
||||
max_token_size=8192,
|
||||
func=lambda texts: openai_embed(
|
||||
texts,
|
||||
model=EMBED_MODEL_NAME,
|
||||
api_key=EMBED_API_KEY,
|
||||
base_url=EMBED_BASE_URL,
|
||||
),
|
||||
)
|
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 236 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 195 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 195 KiB |
After Width: | Height: | Size: 236 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 236 KiB |
After Width: | Height: | Size: 195 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 195 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 460 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 118 KiB |
After Width: | Height: | Size: 234 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 251 KiB |