Instructions to use lzwjava/sec-edgar-gpt-124m-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lzwjava/sec-edgar-gpt-124m-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lzwjava/sec-edgar-gpt-124m-hf")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lzwjava/sec-edgar-gpt-124m-hf") model = AutoModelForCausalLM.from_pretrained("lzwjava/sec-edgar-gpt-124m-hf") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lzwjava/sec-edgar-gpt-124m-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lzwjava/sec-edgar-gpt-124m-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lzwjava/sec-edgar-gpt-124m-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/lzwjava/sec-edgar-gpt-124m-hf
- SGLang
How to use lzwjava/sec-edgar-gpt-124m-hf 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 "lzwjava/sec-edgar-gpt-124m-hf" \ --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": "lzwjava/sec-edgar-gpt-124m-hf", "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 "lzwjava/sec-edgar-gpt-124m-hf" \ --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": "lzwjava/sec-edgar-gpt-124m-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use lzwjava/sec-edgar-gpt-124m-hf with Docker Model Runner:
docker model run hf.co/lzwjava/sec-edgar-gpt-124m-hf
SEC-EDGAR GPT-2 124M
A GPT-2 (124M) model trained from scratch on SEC-EDGAR filings (10-K, 10-Q, 8-K, etc.) using nanoGPT.
Model Details
| Parameter | Value |
|---|---|
| Architecture | GPT-2 (GPT2LMHeadModel) |
| Parameters | ~124M |
| Layers | 12 |
| Hidden size | 768 |
| Attention heads | 12 |
| Context length | 1024 |
| Vocab size | 50,257 |
| Precision | float32 |
Training
- Framework: nanoGPT (Karpathy's)
- Dataset: SEC-EDGAR filings (financial disclosures, annual/quarterly reports)
- Tokenizer: GPT-2 BPE (tiktoken)
Usage
from transformers import GPT2LMHeadModel, GPT2Tokenizer
model = GPT2LMHeadModel.from_pretrained("lzwjava/sec-edgar-gpt-124m-hf")
tokenizer = GPT2Tokenizer.from_pretrained("lzwjava/sec-edgar-gpt-124m-hf")
prompt = "The company reported total revenue of"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.8, top_k=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Intended Use
This model is trained for research and educational purposes โ demonstrating nanoGPT training on domain-specific financial text. It is not suitable for production financial analysis or advice.
Limitations
- Trained on a subset of SEC filings; may not generalize to all financial domains
- No RLHF or instruction tuning โ raw language model only
- Generated text may contain factual inaccuracies
- Downloads last month
- 1