Downloads · 30 days
20
35% of all-time downloads
ohanvi/ohanvi-fix-trade-model
ohanvi-fix-trade-model is a text classification model from ohanvi. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
A tiny DistilBERT model fine-tuned to classify market news headlines and analysis snippets into three trade signals: BUY, SELL, or HOLD.
Downloads · 30 days
20
35% of all-time downloads
All-time downloads
57
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
A tiny DistilBERT model fine-tuned to classify market news headlines and analysis snippets into three trade signals: BUY, SELL, or HOLD.
distilbert-base-uncased (67M parameters)BUY (0) | SELL (1) | HOLD (2)from transformers import pipeline
pipe = pipeline("text-classification", model="ohanvi/ohanvi-fix-trade-model", top_k=None)
result = pipe("Strong earnings beat, revenue up 25%, guidance raised.")
print(result)
# [{'label': 'BUY', 'score': 0.92}, {'label': 'HOLD', 'score': 0.05}, {'label': 'SELL', 'score': 0.03}]
Try it in your browser: Gradio Space
| Hyperparameter | Value |
|---|---|
| Base model | distilbert-base-uncased |
| Epochs | 5 |
| Batch size | 8 |
| Learning rate | 3e-4 |
| Max sequence length | 64 |
| Training samples | 120 |
| Eval samples | 30 |
⚠️ This is a demonstration model trained on a very small dataset. Do not use it for real trading or financial decisions.
ohanvi-fix-trade-model/
├── train.py # Fine-tune the model (runs in ~30 sec)
├── inference.py # Run predictions locally
├── app.py # Gradio demo (deployed to HF Spaces)
├── push_to_hub.py # Upload model + Space to Hugging Face
├── config.py # Central config (loads from .env)
├── requirements.txt # Python dependencies
├── .env.example # Template for secrets
└── README.md # This file
# 1. Install dependencies
pip install -r requirements.txt
# 2. Copy and fill in your credentials
cp .env.example .env
# 3. Train the model (~30 sec)
python train.py
# 4. Test locally
python inference.py --demo
# 5. Push to Hugging Face Hub
python push_to_hub.py