Instructions to use refactai/Refact-1_6-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use refactai/Refact-1_6-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="refactai/Refact-1_6-base", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("refactai/Refact-1_6-base", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use refactai/Refact-1_6-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "refactai/Refact-1_6-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "refactai/Refact-1_6-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/refactai/Refact-1_6-base
- SGLang
How to use refactai/Refact-1_6-base 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 "refactai/Refact-1_6-base" \ --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": "refactai/Refact-1_6-base", "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 "refactai/Refact-1_6-base" \ --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": "refactai/Refact-1_6-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use refactai/Refact-1_6-base with Docker Model Runner:
docker model run hf.co/refactai/Refact-1_6-base
Update config.json
Browse files- config.json +4 -8
config.json
CHANGED
|
@@ -2,15 +2,13 @@
|
|
| 2 |
"architectures": [
|
| 3 |
"GPTRefactForCausalLM"
|
| 4 |
],
|
| 5 |
-
"
|
| 6 |
-
"
|
| 7 |
"auto_map": {
|
| 8 |
"AutoConfig": "configuration_gpt_refact.GPTRefactConfig",
|
| 9 |
"AutoModelForCausalLM": "modeling_gpt_refact.GPTRefactForCausalLM"
|
| 10 |
},
|
| 11 |
-
"bos_token_id": -1,
|
| 12 |
"do_sample": true,
|
| 13 |
-
"embd_pdrop": 0.1,
|
| 14 |
"eos_token_id": 0,
|
| 15 |
"initializer_range": 0.02,
|
| 16 |
"layer_norm_epsilon": 1e-05,
|
|
@@ -21,10 +19,8 @@
|
|
| 21 |
"n_inner": null,
|
| 22 |
"n_layer": 32,
|
| 23 |
"n_positions": 4096,
|
| 24 |
-
"
|
| 25 |
-
"
|
| 26 |
-
"scale_attn_weights": true,
|
| 27 |
-
"torch_dtype": "float32",
|
| 28 |
"transformers_version": "4.31.0",
|
| 29 |
"use_cache": true,
|
| 30 |
"vocab_size": 49216
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"GPTRefactForCausalLM"
|
| 4 |
],
|
| 5 |
+
"attention_bias_in_fp32": true,
|
| 6 |
+
"attention_softmax_in_fp32": true,
|
| 7 |
"auto_map": {
|
| 8 |
"AutoConfig": "configuration_gpt_refact.GPTRefactConfig",
|
| 9 |
"AutoModelForCausalLM": "modeling_gpt_refact.GPTRefactForCausalLM"
|
| 10 |
},
|
|
|
|
| 11 |
"do_sample": true,
|
|
|
|
| 12 |
"eos_token_id": 0,
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
"layer_norm_epsilon": 1e-05,
|
|
|
|
| 19 |
"n_inner": null,
|
| 20 |
"n_layer": 32,
|
| 21 |
"n_positions": 4096,
|
| 22 |
+
"scale_attention_softmax_in_fp32": true,
|
| 23 |
+
"torch_dtype": "bfloat16",
|
|
|
|
|
|
|
| 24 |
"transformers_version": "4.31.0",
|
| 25 |
"use_cache": true,
|
| 26 |
"vocab_size": 49216
|