Instructions to use MagicHub/Chinese-llama2-CLAM-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MagicHub/Chinese-llama2-CLAM-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MagicHub/Chinese-llama2-CLAM-7b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MagicHub/Chinese-llama2-CLAM-7b") model = AutoModelForCausalLM.from_pretrained("MagicHub/Chinese-llama2-CLAM-7b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MagicHub/Chinese-llama2-CLAM-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MagicHub/Chinese-llama2-CLAM-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MagicHub/Chinese-llama2-CLAM-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MagicHub/Chinese-llama2-CLAM-7b
- SGLang
How to use MagicHub/Chinese-llama2-CLAM-7b 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 "MagicHub/Chinese-llama2-CLAM-7b" \ --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": "MagicHub/Chinese-llama2-CLAM-7b", "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 "MagicHub/Chinese-llama2-CLAM-7b" \ --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": "MagicHub/Chinese-llama2-CLAM-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MagicHub/Chinese-llama2-CLAM-7b with Docker Model Runner:
docker model run hf.co/MagicHub/Chinese-llama2-CLAM-7b
Update README.md
Browse files
README.md
CHANGED
|
@@ -5,6 +5,7 @@ language:
|
|
| 5 |
tags:
|
| 6 |
- text-generation-inference
|
| 7 |
---
|
|
|
|
| 8 |
For details see: https://github.com/magichub-opensource/CLAM-Conversational-Language-AI-from-MagicData
|
| 9 |
|
| 10 |
### 模型推理
|
|
@@ -14,7 +15,7 @@ For details see: https://github.com/magichub-opensource/CLAM-Conversational-Lang
|
|
| 14 |
|
| 15 |
#### Web Demo
|
| 16 |
|
| 17 |
-
我们使用 [text-generation-webui](https://github.com/oobabooga/text-generation-webui/tree/main) 开源项目搭建的 demo 进行推理,得到文档中的对比样例。该demo支持
|
| 18 |
|
| 19 |
实验环境:py310-torch1.13.1-cuda11.6-cudnn8
|
| 20 |
|
|
|
|
| 5 |
tags:
|
| 6 |
- text-generation-inference
|
| 7 |
---
|
| 8 |
+
|
| 9 |
For details see: https://github.com/magichub-opensource/CLAM-Conversational-Language-AI-from-MagicData
|
| 10 |
|
| 11 |
### 模型推理
|
|
|
|
| 15 |
|
| 16 |
#### Web Demo
|
| 17 |
|
| 18 |
+
我们使用 [text-generation-webui](https://github.com/oobabooga/text-generation-webui/tree/main) 开源项目搭建的 demo 进行推理,得到文档中的对比样例。该demo支持在网页端切换模型、调整多种常见参数等。
|
| 19 |
|
| 20 |
实验环境:py310-torch1.13.1-cuda11.6-cudnn8
|
| 21 |
|