Views
No views yet
distilbert-base-uncased (67M parameters)BUY (0) | SELL (1) | HOLD (2)1from transformers import pipeline
2
3pipe = pipeline("text-classification", model="ohanvi/ohanvi-fix-trade-model", top_k=None)
4result = pipe("Strong earnings beat, revenue up 25%, guidance raised.")
5print(result)
6# [{'label': 'BUY', 'score': 0.92}, {'label': 'HOLD', 'score': 0.05}, {'label': 'SELL', 'score': 0.03}]| 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 |
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 file1# 1. Install dependencies
2pip install -r requirements.txt
3
4# 2. Copy and fill in your credentials
5cp .env.example .env
6
7# 3. Train the model (~30 sec)
8python train.py
9
10# 4. Test locally
11python inference.py --demo
12
13# 5. Push to Hugging Face Hub
14python push_to_hub.py