首先使用命令(在windows)
git clone < this repo >
cd langgraph_lr
move .env_copy .env然后在.env中配置你的环境变量,你可以在文件中的url获取你的api key
下载依赖:
uv sync注意:
- 使用下列代码生成graph png
from PIL import Image
import io
mermaid_png = app.get_graph().draw_mermaid_png()
image = Image.open(io.BytesIO(mermaid_png))
image.save("mermaid_graph.png")其中app为compile后的graph
- OCR: pdf => .md 包括如何部署模型以及遇到的问题。
- 合并代码
- prompt: 研究如何写prompt (比较简单),
- search tool: 使用arXiv api获取到pdf或其他格式
- 合并代码
- paper模块分析: 分析论文的模块、格式,以及如何分配模块的weight(需要分享)
- 合并代码(根据paper格式embedding)
- 利用SQL,存储用户偏好
- 新的memory管理方法()
- 修改sub agent保存逻辑,使用确定的方式保存一手数据。
- 加入cache机制
- 得到paper的meta data
- main paper 全部 以及 reference meta data
使用wsl:Ubuntu作为运行环境,或参考链接配置环境
安装NVIDIA驱动与CUDA
创建虚拟环境
conda create --name paddle_env python=3.9 --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda activate paddle_env安装paddle (以CUDA11.8为例,其他版本参考链接)
python -m pip install paddlepaddle-gpu==3.2.2 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
pip install "paddlex[ocr]==3.3.9"创建运行脚本
# run.py
from pathlib import Path
from paddleocr import PPStructureV3
input_file = "your/input/directory"
output_path = Path("./output")
pipeline = PPStructureV3()
output = pipeline.predict("your/input/directory")
markdown_list = []
markdown_images = []
for res in output:
md_info = res.markdown
markdown_list.append(md_info)
markdown_images.append(md_info.get("markdown_images", {}))
markdown_texts = pipeline.concatenate_markdown_pages(markdown_list)
mkd_file_path = output_path / f"{Path(input_file).stem}.md"
mkd_file_path.parent.mkdir(parents=True, exist_ok=True)
with open(mkd_file_path, "w", encoding="utf-8") as f:
f.write(markdown_texts)
for item in markdown_images:
if item:
for path, image in item.items():
file_path = output_path / path
file_path.parent.mkdir(parents=True, exist_ok=True)
image.save(file_path)运行
python3 ./run.py