Instructions to use mjoys/jinpan-13B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mjoys/jinpan-13B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mjoys/jinpan-13B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mjoys/jinpan-13B") model = AutoModelForCausalLM.from_pretrained("mjoys/jinpan-13B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mjoys/jinpan-13B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mjoys/jinpan-13B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mjoys/jinpan-13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mjoys/jinpan-13B
- SGLang
How to use mjoys/jinpan-13B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "mjoys/jinpan-13B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mjoys/jinpan-13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "mjoys/jinpan-13B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mjoys/jinpan-13B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mjoys/jinpan-13B with Docker Model Runner:
docker model run hf.co/mjoys/jinpan-13B
【智海-金磐】
浙大人工智能研究所+摸象科技,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
- 3