Text Generation
Transformers
PyTorch
Safetensors
English
gpt_refact
code
custom_code
Eval Results (legacy)
Instructions to use refactai/Refact-1_6B-fim with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use refactai/Refact-1_6B-fim with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="refactai/Refact-1_6B-fim", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("refactai/Refact-1_6B-fim", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use refactai/Refact-1_6B-fim with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "refactai/Refact-1_6B-fim" # 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_6B-fim", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/refactai/Refact-1_6B-fim
- SGLang
How to use refactai/Refact-1_6B-fim 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_6B-fim" \ --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_6B-fim", "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_6B-fim" \ --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_6B-fim", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use refactai/Refact-1_6B-fim with Docker Model Runner:
docker model run hf.co/refactai/Refact-1_6B-fim
Update README.md
Browse files
README.md
CHANGED
|
@@ -640,7 +640,7 @@ prompt_template = "<empty_output>SYSTEM {system}\n" \
|
|
| 640 |
"<empty_output>ASSISTANT"
|
| 641 |
prompt = prompt_template.format(system="You are a programming assistant",
|
| 642 |
query="How do I sort a list in Python?")
|
| 643 |
-
|
| 644 |
|
| 645 |
# Architecture
|
| 646 |
|
|
@@ -698,7 +698,6 @@ and to perform well on a wide range of metrics. The best attempt took 40B tokens
|
|
| 698 |
The Refact-1.6B model was trained on text in English. But it has seen a lot more languages in
|
| 699 |
code comments. Its performance on non-English languages is lower, for sure.
|
| 700 |
|
| 701 |
-
```
|
| 702 |
|
| 703 |
# Model Stats
|
| 704 |
|
|
|
|
| 640 |
"<empty_output>ASSISTANT"
|
| 641 |
prompt = prompt_template.format(system="You are a programming assistant",
|
| 642 |
query="How do I sort a list in Python?")
|
| 643 |
+
```
|
| 644 |
|
| 645 |
# Architecture
|
| 646 |
|
|
|
|
| 698 |
The Refact-1.6B model was trained on text in English. But it has seen a lot more languages in
|
| 699 |
code comments. Its performance on non-English languages is lower, for sure.
|
| 700 |
|
|
|
|
| 701 |
|
| 702 |
# Model Stats
|
| 703 |
|