Downloads · 30 days
11
6% of all-time downloads
mjoys/jinpan-13B
jinpan-13B is a text generation model from mjoys. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
浙大人工智能研究所+摸象科技,2023年8月21日联合发布垂直于金融零售的语言大模型 【智海-金磐大模型】是浙江大学和摸象科技联合发布的一个自主研发的垂直金融的语言大模型,目前模型规模7B、13B,可进一步扩展。训练的数据集垂直于零售金融方向,涵盖了金融书籍、论文,金融知识图谱、金融对话文本等多种数据源 【智海-金磐大模型】的目标是为金融机构提供高效、智能、可信赖的语言服务,包括金融知识问答、金融文本生成、金融知识推理分析等多种应…
Downloads · 30 days
11
6% of all-time downloads
All-time downloads
184
Public
Repo size
53 GB
Likes
0
Public
Click a slice to open those files.
.bin26.5 GB · 100%
From the Hugging Face model README
浙大人工智能研究所+摸象科技,2023年8月21日联合发布垂直于金融零售的语言大模型
Here we show a code snippet to show you how to use the chat model with transformers:
import os
DEVICE_ID = "0"
os.environ['CUDA_VISIBLE_DEVICES'] = DEVICE_ID
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "mjoys/jinpan-13B"
device = "cuda" # the device to load the model onto
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "怎么办理信用卡"
messages = [
{"role": "system", "content": "You are a helpful assistant. 你是一个乐于助人的助手。"},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)