【智海-金磐】

浙大人工智能研究所+摸象科技,2023年8月21日联合发布垂直于金融零售的语言大模型

  • 【智海-金磐大模型】是浙江大学和摸象科技联合发布的一个自主研发的垂直金融的语言大模型,目前模型规模7B、13B,可进一步扩展。训练的数据集垂直于零售金融方向,涵盖了金融书籍、论文,金融知识图谱、金融对话文本等多种数据源
  • 【智海-金磐大模型】的目标是为金融机构提供高效、智能、可信赖的语言服务,包括金融知识问答、金融文本生成、金融知识推理分析等多种应用场景。
  • 【核心特征】解决通用大模型缺乏精准定量解决业务问题的能力,在金融零售领域实现精调适配、专业知识注入、外部知识库协同,以及解决模型输出内容和模型参数、训练数据和外源知识的可解释性溯源。同时具有大模型基础能力和金融领域泛化能力,模型体积小,参数量适中,单个金融企业有限算力可以承载,可以私有化部署,满足数据安全合规要求,同时模型能结合各种本地数据以及集成搜索组件以增强模型输出能力。

Quickstart

🤗 Hugging Face Transformers

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)
Downloads last month
4
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mjoys/jinpan-13B

Quantizations
1 model