Text Generation
Transformers
Safetensors
PyTorch
gpt2
causal-lm
from-scratch
wikipedia
text-generation-inference
Instructions to use dogman189/odysseus-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dogman189/odysseus-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dogman189/odysseus-2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dogman189/odysseus-2") model = AutoModelForCausalLM.from_pretrained("dogman189/odysseus-2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dogman189/odysseus-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dogman189/odysseus-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dogman189/odysseus-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dogman189/odysseus-2
- SGLang
How to use dogman189/odysseus-2 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 "dogman189/odysseus-2" \ --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": "dogman189/odysseus-2", "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 "dogman189/odysseus-2" \ --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": "dogman189/odysseus-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dogman189/odysseus-2 with Docker Model Runner:
docker model run hf.co/dogman189/odysseus-2
Odysseus-2
A tiny GPT-2-style language model (~320M parameters) trained from scratch on a 500MB slice of English Wikipedia.
Model Details
- Architecture: GPT-2 (
GPT2LMHeadModel) - Parameters: ~320M
- Layers: 24
- Attention heads: 16
- Embedding dimension: 1024
- Context length: 512 tokens
- Vocabulary: 16,000 BPE tokens (trained from scratch)
- Training data: ~500MB slice of English Wikipedia
- License: MIT
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "dogman189/odysseus-2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "The history of"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training Details
- Trained from scratch on a ~500MB slice of English Wikipedia
- BPE tokenizer trained separately (vocab 16,000)
- ~2 epochs of training
- See the TinyWiki repository for the full training pipeline
Evaluation
Evaluated on the held-out val split (512-token sequences):
- Eval loss: 3.6507
- Perplexity: 38.50
Limitations
Small model trained on a limited Wikipedia slice — output quality is limited and may contain inaccuracies or repetition. Not suitable for production use without further training or fine-tuning.
- Downloads last month
- 175