Text Generation
Transformers
Safetensors
GGUF
English
gpt2
causal-lm
ff-llm
text-generation-inference
Instructions to use francescofiamingo1/FF_3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use francescofiamingo1/FF_3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="francescofiamingo1/FF_3")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("francescofiamingo1/FF_3") model = AutoModelForCausalLM.from_pretrained("francescofiamingo1/FF_3") - llama-cpp-python
How to use francescofiamingo1/FF_3 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="francescofiamingo1/FF_3", filename="ff3_q4km.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use francescofiamingo1/FF_3 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf francescofiamingo1/FF_3 # Run inference directly in the terminal: llama-cli -hf francescofiamingo1/FF_3
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf francescofiamingo1/FF_3 # Run inference directly in the terminal: llama-cli -hf francescofiamingo1/FF_3
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf francescofiamingo1/FF_3 # Run inference directly in the terminal: ./llama-cli -hf francescofiamingo1/FF_3
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf francescofiamingo1/FF_3 # Run inference directly in the terminal: ./build/bin/llama-cli -hf francescofiamingo1/FF_3
Use Docker
docker model run hf.co/francescofiamingo1/FF_3
- LM Studio
- Jan
- vLLM
How to use francescofiamingo1/FF_3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "francescofiamingo1/FF_3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "francescofiamingo1/FF_3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/francescofiamingo1/FF_3
- SGLang
How to use francescofiamingo1/FF_3 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 "francescofiamingo1/FF_3" \ --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": "francescofiamingo1/FF_3", "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 "francescofiamingo1/FF_3" \ --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": "francescofiamingo1/FF_3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use francescofiamingo1/FF_3 with Ollama:
ollama run hf.co/francescofiamingo1/FF_3
- Unsloth Studio
How to use francescofiamingo1/FF_3 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for francescofiamingo1/FF_3 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for francescofiamingo1/FF_3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for francescofiamingo1/FF_3 to start chatting
- Docker Model Runner
How to use francescofiamingo1/FF_3 with Docker Model Runner:
docker model run hf.co/francescofiamingo1/FF_3
- Lemonade
How to use francescofiamingo1/FF_3 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull francescofiamingo1/FF_3
Run and chat with the model
lemonade run user.FF_3-{{QUANT_TAG}}List all available models
lemonade list
Initial release of FF_3 2.02B
Browse files- README.md +78 -3
- config.json +22 -0
- generation_config.json +10 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- special_tokens_map.json +23 -0
- tokenizer_config.json +23 -0
- vocab.json +0 -0
README.md
CHANGED
|
@@ -1,3 +1,78 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- gpt2
|
| 9 |
+
- causal-lm
|
| 10 |
+
- ff-llm
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# FF_3 — FF-LLM 2.02B
|
| 14 |
+
|
| 15 |
+
FF_3 is a 2.02B parameter language model trained from scratch.
|
| 16 |
+
|
| 17 |
+
## Model Details
|
| 18 |
+
- **Architecture**: GPT-2 decoder-only (custom)
|
| 19 |
+
- **Parameters**: 2,022,739,072
|
| 20 |
+
- **Vocabulary**: 50,257 (GPT-2 BPE tokenizer)
|
| 21 |
+
- **Context length**: 2,048 tokens
|
| 22 |
+
- **Training**: From scratch on 90B tokens
|
| 23 |
+
|
| 24 |
+
## Training Pipeline
|
| 25 |
+
1. **Pretraining**: 90B tokens (web + STEM data)
|
| 26 |
+
2. **SFT**: 760K examples + 100K high-quality examples
|
| 27 |
+
3. **DPO**: 38,863 preference pairs
|
| 28 |
+
4. **Distillation**: 20K examples from Qwen2.5-32B teacher
|
| 29 |
+
|
| 30 |
+
## Prompt Format
|
| 31 |
+
```
|
| 32 |
+
### System:
|
| 33 |
+
You are FF-LLM, a helpful assistant.
|
| 34 |
+
|
| 35 |
+
### Instruction:
|
| 36 |
+
{your question here}
|
| 37 |
+
|
| 38 |
+
### Response:
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Usage with Transformers
|
| 42 |
+
|
| 43 |
+
```python
|
| 44 |
+
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
| 45 |
+
|
| 46 |
+
model = GPT2LMHeadModel.from_pretrained("ff-llm/FF_3")
|
| 47 |
+
tokenizer = GPT2Tokenizer.from_pretrained("ff-llm/FF_3")
|
| 48 |
+
|
| 49 |
+
prompt = (
|
| 50 |
+
"### System:\nYou are FF-LLM, a helpful assistant.\n\n"
|
| 51 |
+
"### Instruction:\nWhat is the capital of France?\n\n### Response:\n"
|
| 52 |
+
)
|
| 53 |
+
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
| 54 |
+
output = model.generate(
|
| 55 |
+
input_ids, max_new_tokens=256, do_sample=True,
|
| 56 |
+
temperature=0.7, top_p=0.9,
|
| 57 |
+
eos_token_id=tokenizer.eos_token_id,
|
| 58 |
+
pad_token_id=tokenizer.eos_token_id,
|
| 59 |
+
)
|
| 60 |
+
print(tokenizer.decode(output[0][input_ids.shape[1]:], skip_special_tokens=True))
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
## Usage with Ollama
|
| 64 |
+
```bash
|
| 65 |
+
ollama run ff-llm/FF_3
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
## Limitations
|
| 69 |
+
- Weak mathematical reasoning
|
| 70 |
+
- May hallucinate on factual questions
|
| 71 |
+
- English only
|
| 72 |
+
|
| 73 |
+
## Training Cost
|
| 74 |
+
~\,000 total compute cost
|
| 75 |
+
Trained by a single researcher
|
| 76 |
+
|
| 77 |
+
## License
|
| 78 |
+
Apache 2.0
|
config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": ["GPT2LMHeadModel"],
|
| 3 |
+
"model_type": "gpt2",
|
| 4 |
+
"vocab_size": 50257,
|
| 5 |
+
"n_embd": 2048,
|
| 6 |
+
"n_head": 16,
|
| 7 |
+
"n_inner": 8192,
|
| 8 |
+
"n_layer": 38,
|
| 9 |
+
"n_positions": 2048,
|
| 10 |
+
"n_ctx": 2048,
|
| 11 |
+
"bos_token_id": 50256,
|
| 12 |
+
"eos_token_id": 50256,
|
| 13 |
+
"activation_function": "gelu_new",
|
| 14 |
+
"attn_pdrop": 0.0,
|
| 15 |
+
"embd_pdrop": 0.0,
|
| 16 |
+
"resid_pdrop": 0.0,
|
| 17 |
+
"layer_norm_epsilon": 1e-05,
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"torch_dtype": "bfloat16",
|
| 20 |
+
"use_cache": true,
|
| 21 |
+
"tie_word_embeddings": true
|
| 22 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 50256,
|
| 3 |
+
"eos_token_id": 50256,
|
| 4 |
+
"pad_token_id": 50256,
|
| 5 |
+
"temperature": 0.7,
|
| 6 |
+
"top_p": 0.9,
|
| 7 |
+
"repetition_penalty": 1.1,
|
| 8 |
+
"max_new_tokens": 512,
|
| 9 |
+
"do_sample": true
|
| 10 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:245872baac62fb882200544b377f6225ef25fa067b0e3914f33468d5e58becb3
|
| 3 |
+
size 4247379640
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<|endoftext|>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": true,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<|endoftext|>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": true,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"unk_token": {
|
| 17 |
+
"content": "<|endoftext|>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": true,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
}
|
| 23 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": false,
|
| 3 |
+
"add_prefix_space": false,
|
| 4 |
+
"added_tokens_decoder": {
|
| 5 |
+
"50256": {
|
| 6 |
+
"content": "<|endoftext|>",
|
| 7 |
+
"lstrip": false,
|
| 8 |
+
"normalized": true,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false,
|
| 11 |
+
"special": true
|
| 12 |
+
}
|
| 13 |
+
},
|
| 14 |
+
"bos_token": "<|endoftext|>",
|
| 15 |
+
"clean_up_tokenization_spaces": false,
|
| 16 |
+
"eos_token": "<|endoftext|>",
|
| 17 |
+
"errors": "replace",
|
| 18 |
+
"extra_special_tokens": {},
|
| 19 |
+
"model_max_length": 1024,
|
| 20 |
+
"pad_token": null,
|
| 21 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 22 |
+
"unk_token": "<|endoftext|>"
|
| 23 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|