jerry1993-tech / Cornucopia-LLaMA-Fin-Chinese

聚宝盆(Cornucopia): 中文金融系列开源可商用大模型,并提供一套高效轻量化的垂直领域LLM训练框架(Pretraining、SFT、RLHF、Quantize等)
https://zhuanlan.zhihu.com/p/633736418
Apache License 2.0
588 stars 61 forks source link

如何运行推理? #3

Open hopeforus opened 1 year ago

hopeforus commented 1 year ago

基础模型下载了,lora也下载了,怎么运行推理呢?

jerry1993-tech commented 1 year ago

参考这里:

单模型推理

bash ./scripts/infer.sh

BASE_MODEL="./base_models/llama-7b-hf"  # or「./base_models/Linly-Chinese-LLaMA-7b-hf」
exp_tag="ori-fb"                        # or「"Linly-zh"」
python3 infer.py \
    --base_model ${BASE_MODEL} \
    --lora_weights './lora-llama-fin-'$exp_tag \
    --use_lora True \
    --instruct_dir './instruction_data/infer.json' \
    --prompt_template 'fin_template'

多模型对比

bash ./scripts/comparison_test.sh