Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.41 KB

run_inference_v2.md

File metadata and controls

37 lines (29 loc) · 1.41 KB

模型推理

我们目前公开的最新版本Lawyer LLaMA是:

  • Lawyer LLaMA 2 (lawyer-llama-13b-v2): 以quzhe/llama_chinese_13B为底座,使用通用instruction和法律instruction进行SFT,配有婚姻相关法律检索模块。

运行环境

建议使用Python 3.8及以上版本。

主要依赖库如下:

  • transformers >= 4.28.0 注意:检索模块需要使用transformers <= 4.30
  • sentencepiece >= 0.1.97
  • gradio

获取模型

  1. HuggingFace下载 **Lawyer LLaMA 2 (lawyer-llama-13b-v2)**模型参数。

  2. HuggingFace下载法条检索模块,并运行其中的python server.py启动法条检索服务,默认挂在9098端口。

模型运行

使用命令行运行

python demo_cmd.py \
--checkpoint /path/to/model \
--classifier_url "http://127.0.0.1:9098/check_hunyin" \
--use_chat_mode

使用交互界面运行

运行以下命令启动交互网页,访问http://127.0.0.1:7863

python demo_web.py \
--port 7863 \
--checkpoint /path/to/model \
--classifier_url "http://127.0.0.1:9098/check_hunyin"

如需使用nginx反向代理访问此服务,可参考https://github.com/LeetJoe/lawyer-llama/blob/main/demo/nginx_proxy.md (Credit to @LeetJoe