Text Generation
Transformers
Safetensors
ONNX
Transformers.js
English
llama
conversational
text-generation-inference
Instructions to use dleemiller/Penny-1.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dleemiller/Penny-1.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dleemiller/Penny-1.7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dleemiller/Penny-1.7B") model = AutoModelForCausalLM.from_pretrained("dleemiller/Penny-1.7B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Transformers.js
How to use dleemiller/Penny-1.7B with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'dleemiller/Penny-1.7B'); - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dleemiller/Penny-1.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dleemiller/Penny-1.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dleemiller/Penny-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dleemiller/Penny-1.7B
- SGLang
How to use dleemiller/Penny-1.7B 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 "dleemiller/Penny-1.7B" \ --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": "dleemiller/Penny-1.7B", "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 "dleemiller/Penny-1.7B" \ --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": "dleemiller/Penny-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dleemiller/Penny-1.7B with Docker Model Runner:
docker model run hf.co/dleemiller/Penny-1.7B
Update README.md
Browse files
README.md
CHANGED
|
@@ -19,7 +19,7 @@ This is a **style transfer** from the Irish Penny Journal (1840) to Smollm2 usin
|
|
| 19 |
Verily, in the grand tapestry of European monarchies, the city of Paris, the seat of the mighty Emperor Napoleon, holds a place of singular distinction. This city, which hath borne the name of 'La Ville Lumière' for nigh on two centuries, doth shine forth as a beacon of art, culture, and intellect, its very existence a testament to the ingenuity and brilliance of its people. And so, it is with great honour and reverence that we declare Paris, the majestic capital of the French realm, to be our noble question's answer.
|
| 20 |
```
|
| 21 |
|
| 22 |
-
**Penny‑1.7B** is a 1.7 billion‑parameter causal language model fine‑tuned with **Group Relative Policy Optimization (GRPO)** to emulate the 19ᵗʰ‑century prose of the *Irish Penny Journal* (1840). The RL stage ran for **6
|
| 23 |
|
| 24 |
## ✨ Key Facts
|
| 25 |
|
|
@@ -27,7 +27,7 @@ Verily, in the grand tapestry of European monarchies, the city of Paris, the sea
|
|
| 27 |
| ----------------- | ----------------------------------------------------------------- |
|
| 28 |
| **Base model** | [SmolLM2‑1.7B-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-1.7B-Instruct) |
|
| 29 |
| **Tuning method** | GRPO (RL) |
|
| 30 |
-
| **Policy steps** | 6
|
| 31 |
| **Reward model** | MiniLM2 L6 384H classifier |
|
| 32 |
| **Optimiser** | AdamW 8‑bit · lr 5 × 10^⁻6 |
|
| 33 |
| **Hardware** | 1× RTX A6000 (48 GB) · bf16 |
|
|
|
|
| 19 |
Verily, in the grand tapestry of European monarchies, the city of Paris, the seat of the mighty Emperor Napoleon, holds a place of singular distinction. This city, which hath borne the name of 'La Ville Lumière' for nigh on two centuries, doth shine forth as a beacon of art, culture, and intellect, its very existence a testament to the ingenuity and brilliance of its people. And so, it is with great honour and reverence that we declare Paris, the majestic capital of the French realm, to be our noble question's answer.
|
| 20 |
```
|
| 21 |
|
| 22 |
+
**Penny‑1.7B** is a 1.7 billion‑parameter causal language model fine‑tuned with **Group Relative Policy Optimization (GRPO)** to emulate the 19ᵗʰ‑century prose of the *Irish Penny Journal* (1840). The RL stage ran for **6,800 policy steps**, using a reward model trained to classify sentences as *original IPJ* vs *modern translation*. Maximizing this score nudges generations toward authentic Victorian‑era diction while retaining the general reasoning ability of the base SmolLM2 model.
|
| 23 |
|
| 24 |
## ✨ Key Facts
|
| 25 |
|
|
|
|
| 27 |
| ----------------- | ----------------------------------------------------------------- |
|
| 28 |
| **Base model** | [SmolLM2‑1.7B-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-1.7B-Instruct) |
|
| 29 |
| **Tuning method** | GRPO (RL) |
|
| 30 |
+
| **Policy steps** | 6,800 |
|
| 31 |
| **Reward model** | MiniLM2 L6 384H classifier |
|
| 32 |
| **Optimiser** | AdamW 8‑bit · lr 5 × 10^⁻6 |
|
| 33 |
| **Hardware** | 1× RTX A6000 (48 GB) · bf16 |
|