Skip to main content

大模型训练,评估,推理,部署工具

Project description

OSC-LLM

PyTorch Lightning

📌   简介

osc-llm旨在成为一个简单易用的大模型训练、评估、推理、部署工具,支持主流的大模型。

文档地址:

📌   安装

📌   快速开始

# 下面以llama3为例演示如何转换为osc-llm格式,并进行聊天。
# 假设你已经下载好huggingface的llama3模型在checkpoints/meta-llama目录下
# 1. 转换
llm convert --checkpoint_dir checkpoints/meta-llama/Meta-Llama-3-8B-Instruct
# 2. 量化
llm quantize int8 --checkpoint_dir checkpoints/meta-llama/Meta-Llama-3-8B-Instruct --save_dir checkpoints/meta-llama/Meta-Llama-3-8B-Instruct-int8
# 3. 聊天(使用编译功能加速推理速度,需要等待几分钟编译时间)
llm chat --checkpoint_dir checkpoints/meta-llama/Meta-Llama-3-8B-Instruct-int8 --compile true
# 4. 部署
llm serve --checkpoint_dir checkpoints/meta-llama/Meta-Llama-3-8B-Instruct-int8

📌   模型支持

以下huggingface中的模型结构(查看config.json)已经支持转换为osc-llm格式:

  • LlamaForCausalLM: llama2, llama3, chinese-alpaca2等。
  • Qwen2ForCausalLM: qwen1.5系列。
  • Qwen2MoeForCausalLM: qwen2-moe系列(目前无法完成编译,推理速度很慢)。

致敬

本项目参考了大量的开源项目,特别是以下项目:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osc_llm-0.1.5.tar.gz (35.7 kB view hashes)

Uploaded Source

Built Distribution

osc_llm-0.1.5-py3-none-any.whl (49.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page