月度归档:2025年03月

RAGFlow安装

1.Docker 与 Docker-compose安装

docker安装

sudo apt update && sudo apt install docker.io apparmor -y

docker-compose安装

sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

测试:docker-compose

RAGFlow下载

git clone https://github.com/infiniflow/ragflow.git

cd ragflow/docker

安装RAGflow

docker-compose -f docker-compose.yml up -d

直接通过命令 docker ps 查看信息;

浏览器访问 http://IP 即可进入

RAG 搭建 anythingllm 建议E5v2之前不要尝试 包括V2

angthingllm 可以本地桌面和搭建服务器web端。

下面是WEB端的搭建(需要DOCKER):
Ubuntu下Docker sudo apt update && sudo apt install docker.io apparmor -y

anythingLLM 的Docker部署命令:

export STORAGE_LOCATION=$HOME/anythingllm && \
mkdir -p $STORAGE_LOCATION && \
touch "$STORAGE_LOCATION/.env" && \
docker run -d -p 3001:3001 \
--cap-add SYS_ADMIN \
-v ${STORAGE_LOCATION}:/app/server/storage \
-v ${STORAGE_LOCATION}/.env:/app/server/.env \
-e STORAGE_DIR="/app/server/storage" \
mintplexlabs/anythingllm

访问你的http://IP:3001 即可

坑点:

E5 V2 CPU 不支持 会在首页设置模型处报错,docker直接下线。

vultr 新建4C 8G 可以运行

需要给anythingllm目录整体给予777 权限 即可,下面步骤:

  • 1.即先docker运行失败,后再加入执行
  • 2.chmod -R 777 anythingllm
  • 3.再执行docker命令启动

docker logs报错/usr/local/bin/docker-entrypoint.sh: line 7:   105 Illegal instruction     (core dumped) node /app/server/index.js

在网页设置中 无法进入下一步,网页显示报错
Failed to save LLM settings: Failed to fetch

在默认设置的目录需要写入权限 直接777 完事 chmod -R 777 $HOME/anythingllm

MAC上部署Wan2.1 1.3b生成视频模型安装 ERROR 250312

flash-attention 只能X86下CUDA。apple的MPS 无法安装!!!

撤退!

主要是 :下载代码库,安装依赖,下载模型,调用即可。

  1. GIT上下载Wan2.1 git clone https://github.com/Wan-Video/Wan2.1.git
  2. 进入刚刚下载的wan2.1的目录,在其中安装 pip install -r requirements.txt 其中注意flash-attention的安装;使用清华源安装 pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
  3. 执行修改为hf-mirror的镜像:export HF_ENDPOINT=https://hf-mirror.com;hf-mirror上下载 Wan-AI/Wan2.1-T2V-1.3B huggingface-cli download Wan-AI/Wan2.1-T2V-1.3B --local-dir ./Wan2.1-T2V-1.3B
  4. 进入GIT下载的wan2.1目录进行测试。python generate.py --task t2v-1.3B --size 832*480 --ckpt_dir ./Wan2.1-T2V-1.3B --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."

1.3B只能txt,不能图片转视频且只能最高480P。14B可以指出图片转视频最高720P。

下面来自wan2.1的官方部署信息。

 Installation
Clone the repo:
git clone https://github.com/Wan-Video/Wan2.1.git cd Wan2.1
Install dependencies:
# Ensure torch >= 2.4.0 pip install -r requirements.txt
 Model Download
Models
Download Link
Notes
T2V-14B
🤗 Huggingface 🤖 ModelScope
Supports both 480P and 720P
I2V-14B-720P
🤗 Huggingface 🤖 ModelScope
Supports 720P
I2V-14B-480P
🤗 Huggingface 🤖 ModelScope
Supports 480P
T2V-1.3B
🤗 Huggingface 🤖 ModelScope
Supports 480P
💡Note: The 1.3B model is capable of generating videos at 720P resolution. However, due to limited training at this resolution, the results are generally less stable compared to 480P. For optimal performance, we recommend using 480P resolution.
Download models using 🤗 huggingface-cli:
pip install "huggingface_hub[cli]" huggingface-cli download Wan-AI/Wan2.1-T2V-1.3B --local-dir ./Wan2.1-T2V-1.3B
Download models using 🤖 modelscope-cli:
pip install modelscope modelscope download Wan-AI/Wan2.1-T2V-1.3B --local_dir ./Wan2.1-T2V-1.3B
 Run Text-to-Video Generation
This repository supports two Text-to-Video models (1.3B and 14B) and two resolutions (480P and 720P). The parameters and configurations for these models are as follows:
Task
Resolution
Model
480P
720P
t2v-14B
✔️
✔️
Wan2.1-T2V-14B
t2v-1.3B
✔️

Wan2.1-T2V-1.3B
 (1) Without Prompt Extention
To facilitate implementation, we will start with a basic version of the inference process that skips the prompt extension step.
Single-GPU inference
python generate.py --task t2v-1.3B --size 832*480 --ckpt_dir ./Wan2.1-T2V-1.3B --sample_shift 8 --sample_guide_scale 6 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
If you encounter OOM (Out-of-Memory) issues, you can use the --offload_model True and --t5_cpu options to reduce GPU memory usage. For example, on an RTX 4090 GPU:
python generate.py --task t2v-1.3B --size 832*480 --ckpt_dir ./Wan2.1-T2V-1.3B --offload_model True --t5_cpu --sample_shift 8 --sample_guide_scale 6 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
💡Note: If you are using the T2V-1.3B model, we recommend setting the parameter --sample_guide_scale 6. The --sample_shift parameter can be adjusted within the range of 8 to 12 based on the performance.
Multi-GPU inference using FSDP + xDiT USP
pip install "xfuser>=0.4.1" torchrun --nproc_per_node=8 generate.py --task t2v-1.3B --size 832*480 --ckpt_dir ./Wan2.1-T2V-1.3B --dit_fsdp --t5_fsdp --ulysses_size 8 --sample_shift 8 --sample_guide_scale 6 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."

利息计算

每个类型的利息计算单独自拿出来,1。传入数据自动计算再返回数据

计算第一期利息 月度和季度有问题;第一期计算;执行start开始日期小于合同开始日期为第一期,则开始日期修改为合同开始日期。

最后一期,当合同结束日期,小于end日期,则结束日期修改为合同结束日期。

提前结束合同,会有个值出现时提前结束合同,相当于合同结束日期。

合同结束日期:如果合同提前结束日期出现,那么合同结束日期就改为合同提前结束日期。

每期利息都计入数据表;利率 、开始日期 、结束日期 、天数、 剩余本金 、贷款ID。

结算利息

剩余本金*间隔的天数*每日的利息=结算所需要的利息

剩余本金=本金-已还本金

间隔天数=选择的间隔类型:月 季度 年 固定日期(需要自己设定 开始结束日期)

每日的利息:

1.LPR调整利息(更具采集的LPR及选择LPR类型(1,3)及上浮的点数)/360

2.固定利息/360

A:数据库查询 在还款日期前的最近一次利息:LPR 或者固定利息

B:间隔天数 设置对应的函数 用于夸周期的天数生产;

C:触发周期,即利息计算:进入新的月份后 执行查询,根据贷款及债券的利息还款设置,通过数据库查询得出间隔天数,和对应的利息。

C.1:对于不同的查询 1 月度 2 季度 3 年度 4 固定(结算月份)

问题1. 是否存在约定15日利息收取?

问题2.是否存在债券 的年度付款利息 不为20号 ,即10年债券是否每年12月10号 付利息?