Instructions to use CofeAI/FLM-101B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CofeAI/FLM-101B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CofeAI/FLM-101B", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("CofeAI/FLM-101B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CofeAI/FLM-101B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CofeAI/FLM-101B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CofeAI/FLM-101B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CofeAI/FLM-101B
- SGLang
How to use CofeAI/FLM-101B 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 "CofeAI/FLM-101B" \ --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": "CofeAI/FLM-101B", "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 "CofeAI/FLM-101B" \ --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": "CofeAI/FLM-101B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CofeAI/FLM-101B with Docker Model Runner:
docker model run hf.co/CofeAI/FLM-101B
eos token id modified
Browse files- config.json +2 -2
- configuration_flm.py +5 -5
config.json
CHANGED
|
@@ -6,10 +6,10 @@
|
|
| 6 |
"AutoModel": "modeling_flm.FLM",
|
| 7 |
"AutoModelForCausalLM": "modeling_flm.FLM"
|
| 8 |
},
|
| 9 |
-
"bos_token_id":
|
| 10 |
"cls_token_id": 100351,
|
| 11 |
"embd_pdrop": 0.1,
|
| 12 |
-
"eos_token_id":
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
"input_mult": 1.0,
|
| 15 |
"layer_norm_epsilon": 1e-05,
|
|
|
|
| 6 |
"AutoModel": "modeling_flm.FLM",
|
| 7 |
"AutoModelForCausalLM": "modeling_flm.FLM"
|
| 8 |
},
|
| 9 |
+
"bos_token_id": 100256,
|
| 10 |
"cls_token_id": 100351,
|
| 11 |
"embd_pdrop": 0.1,
|
| 12 |
+
"eos_token_id": 100256,
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
"input_mult": 1.0,
|
| 15 |
"layer_norm_epsilon": 1e-05,
|
configuration_flm.py
CHANGED
|
@@ -146,11 +146,11 @@ class FLMConfig(PretrainedConfig):
|
|
| 146 |
summary_first_dropout=0.1,
|
| 147 |
scale_attn_weights=True,
|
| 148 |
use_cache=True,
|
| 149 |
-
bos_token_id=
|
| 150 |
-
eos_token_id=
|
| 151 |
-
cls_token_id=
|
| 152 |
-
sep_token_id=
|
| 153 |
-
pad_token_id=
|
| 154 |
scale_attn_by_inverse_layer_idx=False,
|
| 155 |
reorder_and_upcast_attn=False,
|
| 156 |
relative_encoding=None,
|
|
|
|
| 146 |
summary_first_dropout=0.1,
|
| 147 |
scale_attn_weights=True,
|
| 148 |
use_cache=True,
|
| 149 |
+
bos_token_id=None,
|
| 150 |
+
eos_token_id=None,
|
| 151 |
+
cls_token_id=None,
|
| 152 |
+
sep_token_id=None,
|
| 153 |
+
pad_token_id=None,
|
| 154 |
scale_attn_by_inverse_layer_idx=False,
|
| 155 |
reorder_and_upcast_attn=False,
|
| 156 |
relative_encoding=None,
|