Commit e9a3ef66 authored by wanglch's avatar wanglch
Browse files

Update infernece_FinGPT.py

parent 3dd62397
......@@ -3,14 +3,12 @@ import platform
import signal
from transformers import AutoTokenizer, AutoModel
import readline
from peft import PeftModel
base_model = '../FinGPT/THUDM/chatglm2-6b' # 模型地址,可在对应模型官网进行下载模型文件,也可以直接使用huggingface的模型加载
lora_model = '../FinGPT/saves/FinGPT/pretrained_lora/fingpt-mt_chatglm2-6b_lora' # 需要下载,本地模型预训练权重,可在 <https://huggingface.co/FinGPT>下载对应模型的预训练权重
base_model = '/home/wanglch/projects/FinGPT/FinGPT_mt_chatglm2-6b-merged'
tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
model = AutoModel.from_pretrained(base_model, trust_remote_code=True, device_map = "auto")
lora_model = PeftModel.from_pretrained(model, lora_model)
# 多显卡支持,使用下面两行代替上面一行,将num_gpus改为你实际的显卡数量
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment