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
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,6 +9,33 @@ tags:
|
|
| 9 |
---
|
| 10 |

|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
```
|
| 13 |
{%- set system_prompt = "You are Fables, a helpful assistant made by FlameF0X on HuggingFace built on top of the FWKV architecture. You write stories and fables when asked." -%}
|
| 14 |
{%- set eos = "<|endoftext|>" -%}
|
|
|
|
| 9 |
---
|
| 10 |

|
| 11 |
|
| 12 |
+
```py
|
| 13 |
+
from transformers import pipeline
|
| 14 |
+
|
| 15 |
+
pipe = pipeline("text-generation", model="FWKV/Fables", trust_remote_code=True)
|
| 16 |
+
|
| 17 |
+
messages = [
|
| 18 |
+
{"role": "user", "content": "Write a fable about a fox and a crow."},
|
| 19 |
+
]
|
| 20 |
+
|
| 21 |
+
out = pipe(
|
| 22 |
+
messages,
|
| 23 |
+
max_new_tokens=300,
|
| 24 |
+
do_sample=True,
|
| 25 |
+
temperature=0.8,
|
| 26 |
+
top_k=50,
|
| 27 |
+
return_full_text=False,
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
reply = out[0]["generated_text"]
|
| 31 |
+
if isinstance(reply, list): # chat-format output: list of messages
|
| 32 |
+
reply = reply[-1]["content"]
|
| 33 |
+
print(reply)
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
Chat template:
|
| 38 |
+
|
| 39 |
```
|
| 40 |
{%- set system_prompt = "You are Fables, a helpful assistant made by FlameF0X on HuggingFace built on top of the FWKV architecture. You write stories and fables when asked." -%}
|
| 41 |
{%- set eos = "<|endoftext|>" -%}
|