Text Generation
Transformers
Safetensors
English
fwkv
feature-extraction
rnn
conversational
custom_code
Instructions to use FWKV/Fables with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FWKV/Fables with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FWKV/Fables", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("FWKV/Fables", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FWKV/Fables with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FWKV/Fables" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FWKV/Fables", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FWKV/Fables
- SGLang
How to use FWKV/Fables 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 "FWKV/Fables" \ --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": "FWKV/Fables", "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 "FWKV/Fables" \ --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": "FWKV/Fables", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FWKV/Fables with Docker Model Runner:
docker model run hf.co/FWKV/Fables
File size: 1,242 Bytes
749540f a0d112e 749540f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | {
"accum_steps": 8,
"arch_version": 2,
"auto_map": {
"AutoConfig": "configuration_fwkv.FWKVConfig",
"AutoModel": "modeling_fwkv.FWKVLanguageModel",
"AutoModelForCausalLM": "modeling_fwkv.FWKVLanguageModel"
},
"architectures": [
"FWKVLanguageModel"
],
"batch_size": 4,
"ce_chunk": 512,
"chinchilla_scale": true,
"d_emb": 384,
"d_model": 768,
"dtype": "float32",
"early_stop_patience": 2,
"epochs": 1,
"eval_every_opt_steps": 100,
"ffn_mult": 4,
"grad_clip": 1.0,
"head_size": 64,
"keep_last_ckpts": 2,
"log_every": 50,
"lr": 0.0004,
"max_val_examples": 128,
"min_lr_ratio": 0.1,
"model_type": "fwkv",
"n_layers": 13,
"prefetch_chunks": 512,
"save_every_steps": 500,
"seq_len": 1024,
"sft_epochs": 3,
"sft_lr": 5e-05,
"sft_max_train_examples": 40000,
"sft_max_val_examples": 1000,
"sft_val_skip_rows": 2000,
"shuffle_buffer_size": 10000,
"tau_max": 1000.0,
"tau_min": 2.0,
"tie_word_embeddings": true,
"train_tokens": 20000000000,
"transformers_version": "5.16.1",
"use_amp": true,
"vocab_size": 50280,
"warmup_steps": 1000,
"weight_decay": 0.1,
"wikitext_max_chunks": 128,
"wikitext_val": true,
"wkv_ceil": 0.999,
"wkv_floor": 0.1
}
|