metadata
language:
- en
faizack/kronos-small-custom
Custom Hugging Face model repo for deploying the Kronos-small time-series forecasting model as an Inference Endpoint.
This folder is structured so you can zip it or git init it and push directly to Hugging Face under your account faizack.
1. Files expected in this repo
You will need the following files in the root of the Hugging Face repo:
config.json– copied or downloaded fromNeoQuasar/Kronos-smallmodel.safetensors– weights fromNeoQuasar/Kronos-smallmodel.py– Kronos model definition (from the official GitHub repo)tokenizer.py– Kronos tokenizer implementationpredictor.py–KronosPredictorwrapperinference.py– entrypoint used by Hugging Face Inference Endpoints (already provided here)requirements.txt– Python dependencies (already provided here)
This folder currently includes:
README.md(this file)inference.pyrequirements.txt.env.example.gitattributes(Git LFS for safetensors).gitignore
You still need to add:
config.jsonmodel.safetensorsmodel.pytokenizer.pypredictor.py
2. How to prepare and push to Hugging Face
From this folder:
cd kronos-small-custom
# (optional) initialize git
git init
git lfs install
# Log in to Hugging Face
huggingface-cli login
# Create the remote repo under your account
huggingface-cli repo create faizack/kronos-small-custom --type model
# Add HF remote
git remote add origin https://huggingface.co/faizack/kronos-small-custom
Now copy in the Kronos implementation and weights:
- From the official Kronos GitHub repo, copy:
model.pytokenizer.pypredictor.py
- From
NeoQuasar/Kronos-smallon Hugging Face, download:config.jsonmodel.safetensors
Then commit and push:
git add .
git commit -m "Initial Kronos-small custom deployment"
git push -u origin main
3. Inference contract
inference.py exposes a predict(request) function that Hugging Face Inference Endpoints will call.
Expected JSON body:
{
"inputs": {
"df": [
{"open": 1.0, "high": 1.1, "low": 0.9, "close": 1.05},
{"open": 1.05, "high": 1.12, "low": 1.0, "close": 1.08}
],
"x_timestamp": ["2024-01-01T00:00:00Z", "2024-01-01T01:00:00Z"],
"y_timestamp": ["2024-01-01T02:00:00Z", "2024-01-01T03:00:00Z"],
"pred_len": 2,
"T": 1.0,
"top_p": 0.9,
"sample_count": 1
}
}
Response structure:
{
"predictions": [
{
"open": ...,
"high": ...,
"low": ...,
"close": ...
},
{
"open": ...,
"high": ...,
"low": ...,
"close": ...
}
]
}
You can adapt this contract as needed, as long as predict returns JSON-serializable data.