Text Generation
Transformers
PyTorch
English
crystalcoder
llm
code
custom_code
Eval Results (legacy)
Instructions to use IFM/CrystalChat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IFM/CrystalChat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IFM/CrystalChat", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("IFM/CrystalChat", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IFM/CrystalChat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IFM/CrystalChat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/CrystalChat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/IFM/CrystalChat
- SGLang
How to use IFM/CrystalChat 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 "IFM/CrystalChat" \ --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": "IFM/CrystalChat", "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 "IFM/CrystalChat" \ --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": "IFM/CrystalChat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use IFM/CrystalChat with Docker Model Runner:
docker model run hf.co/IFM/CrystalChat
Update README.md
Browse files
README.md
CHANGED
|
@@ -42,6 +42,27 @@ The summary of the instruction tuning data is as follows:
|
|
| 42 |
|
| 43 |
<center><img src="data_table.jpg" alt="Instruction Data"/></center>
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
# Reproducing the Results
|
| 46 |
|
| 47 |
We will realize the training code and the training data soon. Our training code is based on [Megatron-LM](https://github.com/NVIDIA/Megatron-LM), with some modifications to support our training data format and Maximal Update Parametrization (μP).
|
|
|
|
| 42 |
|
| 43 |
<center><img src="data_table.jpg" alt="Instruction Data"/></center>
|
| 44 |
|
| 45 |
+
# Instruction Format
|
| 46 |
+
|
| 47 |
+
We've added some new special tokens to the CrystalCoder tokenizer to support the instruction tuning.
|
| 48 |
+
|
| 49 |
+
List special tokens used in the instruction tuning:
|
| 50 |
+
|
| 51 |
+
```
|
| 52 |
+
bos: <s>
|
| 53 |
+
eos: </s>
|
| 54 |
+
system_start: <|sys_start|>
|
| 55 |
+
system_end: <|sys_end|>
|
| 56 |
+
user_start: <|im_start|>
|
| 57 |
+
user_end: <|im_end|>
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
The instruction format is as follows:
|
| 61 |
+
|
| 62 |
+
```
|
| 63 |
+
<s> <|sys_start|> system prompt <|sys_end|> <|im_start|> first user utterance <|im_end|> first model response <|im_start|> next user utterance <|im_end|> next model response </s>
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
# Reproducing the Results
|
| 67 |
|
| 68 |
We will realize the training code and the training data soon. Our training code is based on [Megatron-LM](https://github.com/NVIDIA/Megatron-LM), with some modifications to support our training data format and Maximal Update Parametrization (μP).
|