Text Generation
Transformers
Safetensors
English
fabric
efficient
0.7b
causal-lm
chunked-memory
conversational
custom_code
Instructions to use FabricAI/Fabric1.5-0.7B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FabricAI/Fabric1.5-0.7B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FabricAI/Fabric1.5-0.7B-Instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("FabricAI/Fabric1.5-0.7B-Instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FabricAI/Fabric1.5-0.7B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FabricAI/Fabric1.5-0.7B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FabricAI/Fabric1.5-0.7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FabricAI/Fabric1.5-0.7B-Instruct
- SGLang
How to use FabricAI/Fabric1.5-0.7B-Instruct 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 "FabricAI/Fabric1.5-0.7B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FabricAI/Fabric1.5-0.7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "FabricAI/Fabric1.5-0.7B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FabricAI/Fabric1.5-0.7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FabricAI/Fabric1.5-0.7B-Instruct with Docker Model Runner:
docker model run hf.co/FabricAI/Fabric1.5-0.7B-Instruct
| { | |
| "additional_special_tokens": [ | |
| "<|system|>", | |
| "<|user|>", | |
| "<|assistant|>" | |
| ], | |
| "bos_token": "<bos>", | |
| "chat_template": "{% set default_system_prompt = \"You are Fabric, a large language model developed by Fabric AI.\" %}{% set ns = namespace(has_system=false) %}{% for message in messages %}{% if message['role'] == 'system' %}{% set ns.has_system = true %}{% endif %}{% endfor %}{% if not ns.has_system %}<|system|>\n{{ default_system_prompt }}<|end|>\n{% endif %}{% for message in messages %}{% if message['role'] == 'system' %}<|system|>\n{{ message['content'] }}<|end|>\n{% elif message['role'] == 'user' %}<|user|>\n{{ message['content'] }}<|end|>\n{% elif message['role'] == 'assistant' %}<|assistant|>\n{{ message['content'] }}<|end|>\n{% endif %}{% endfor %}{% if add_generation_prompt %}<|assistant|>\n{% endif %}", | |
| "chat_template_file": "chat_template.jinja", | |
| "default_system_prompt": "You are Fabric, a large language model developed by Fabric AI.", | |
| "eos_token": "<|end|>", | |
| "model_max_length": 32768, | |
| "pad_token": "<pad>", | |
| "tokenizer_class": "PreTrainedTokenizerFast", | |
| "unk_token": "<unk>" | |
| } | |