Downloads · 30 days
23
24% of all-time downloads
SeanJIE250/llama2_chatbot_law
llama2_chatbot_law is a text generation model from SeanJIE250. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
Downloads · 30 days
23
24% of all-time downloads
All-time downloads
96
Public
Parameters
6.7B
13.6 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors13.5 GB · 99%
From the Hugging Face model README
Email:[email protected]
Give me some red stars ♥️ if u like this model! It's the model focused on Law field, honestly,doing bad as a daily chatbot however,start to know Mandarin and can handle the case study in details.
老玩家点点红星♥️!中文法律对话机器人,具体案件审理较为不错。
First at first , implementing this command needs transformer library ,you can do the download directly.Hope u well!
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = "SeanJIE250/chatbot_LAW"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="auto",
torch_dtype='auto'
).eval()
# Prompt content: "hi"
messages = [
{"role": "user", "content": "杀了人在中国判多少年?"}
]
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
outputs = model.generate(input_ids.to('cuda'),max_new_tokens=200)//you can adjust the max_new_tokens as you want.
response = tokenizer.decode(outputs[0][input_ids.shape[1]:], skip_special_tokens=False)
print(response)
messages = [
{"role": "user", "content": "How to split the property if I divorced with my handsband?"}
]
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
outputs = model.generate(input_ids.to('cuda'),max_new_tokens=200)//you can adjust the max_new_tokens as you want.
response = tokenizer.decode(outputs[0][input_ids.shape[1]:], skip_special_tokens=False)
print(response)