🚀 Equall/Saul-Instruct-v1
Equall/Saul-Instruct-v1是一款专门为法律领域定制的大型指令语言模型。它通过对Mistral - 7B进行持续预训练而得到,能有效处理法律相关的生成任务。
访问我们的网站并注册:https://equall.ai/

🚀 快速开始
你可以使用此模型处理涉及生成的法律用例。以下是如何使用🤗 Transformers库中的pipeline()
函数来运行该模型的示例:
import torch
from transformers import pipeline
pipe = pipeline("text-generation", model="Equall/Saul-Instruct-v1", torch_dtype=torch.bfloat16, device_map="auto")
messages = [
{"role": "user", "content": "[YOUR QUERY GOES HERE]"},
]
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipe(prompt, max_new_tokens=256, do_sample=False)
print(outputs[0]["generated_text"])
✨ 主要特性
- 专为法律领域定制,能更好地处理法律相关的生成任务。
- 基于Mistral - 7B进行持续预训练,继承了其优秀的语言处理能力。
📦 安装指南
若使用的transformers版本 <= v4.34,需要从源代码安装transformers:
pip install git+https://github.com/huggingface/transformers.git
同时,需要安装accelerate
:
pip install accelerate
💻 使用示例
基础用法
import torch
from transformers import pipeline
pipe = pipeline("text-generation", model="Equall/Saul-Instruct-v1", torch_dtype=torch.bfloat16, device_map="auto")
messages = [
{"role": "user", "content": "[YOUR QUERY GOES HERE]"},
]
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipe(prompt, max_new_tokens=256, do_sample=False)
print(outputs[0]["generated_text"])
📚 详细文档
模型详情
模型描述
这是一个已发布在Hugging Face Hub上的🤗 transformers模型的卡片,该模型卡片是自动生成的。
属性 |
详情 |
开发者 |
Equall.ai与CentraleSupelec、Sorbonne Université、Instituto Superior Técnico和NOVA School of Law合作开发 |
模型类型 |
7B |
语言(NLP) |
英语 |
许可证 |
MIT |
模型来源
- 论文:https://arxiv.org/abs/2403.03883
偏差、风险和局限性
此模型基于大语言模型(LLM)技术构建,存在固有的局限性。它偶尔可能会生成不准确或无意义的输出。此外,作为一个7B的模型,预计其性能不如更大的模型,如70B的变体。
引用
BibTeX:
@misc{colombo2024saullm7b,
title={SaulLM-7B: A pioneering Large Language Model for Law},
author={Pierre Colombo and Telmo Pessoa Pires and Malik Boudiaf and Dominic Culver and Rui Melo and Caio Corro and Andre F. T. Martins and Fabrizio Esposito and Vera Lúcia Raposo and Sofia Morgado and Michael Desa},
year={2024},
eprint={2403.03883},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
📄 许可证
本模型采用MIT许可证。