Time Series Forecasting
Transformers
PyTorch
Korean
jnu_tsb
feature-extraction
jnu-tsb
time-series
forecasting
chronos-2
polyglot-ko
korean
finance
covariates
r
reticulate
education
custom_code
Instructions to use HONGRIZON/JNU-TSB with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HONGRIZON/JNU-TSB with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("HONGRIZON/JNU-TSB", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
| from __future__ import annotations | |
| import json | |
| from pathlib import Path | |
| from typing import Any | |
| import gradio as gr | |
| import pandas as pd | |
| from runtime import JNUTSBRuntime | |
| runtime = JNUTSBRuntime.from_config_dir(Path(__file__).parent) | |
| DEFAULT_STOCK = """timestamp,target | |
| 2024-12-01,71000 | |
| 2024-12-02,71800 | |
| 2024-12-03,70400 | |
| 2024-12-04,70900 | |
| 2024-12-05,72100 | |
| """ | |
| DEFAULT_NEWS = """[ | |
| {"date": "2024-12-01", "title": "์ผ์ฑ์ ์ HBM ์ ์ ํ ์ถ์"}, | |
| {"date": "2024-12-02", "title": "๋ฐ๋์ฒด ์ ํฉ ๋ํ ์ฐ๋ ค"} | |
| ]""" | |
| def run_demo(stock_csv: str, news_json: str, prediction_length: int, use_llm_extractor: bool) -> Any: | |
| from io import StringIO | |
| stock = pd.read_csv(StringIO(stock_csv)) if stock_csv.strip() else None | |
| news = json.loads(news_json) if news_json.strip() else None | |
| result = runtime.predict( | |
| inputs={"stock": stock, "news": news}, | |
| prediction_length=int(prediction_length), | |
| use_llm_extractor=bool(use_llm_extractor), | |
| ) | |
| return result | |
| with gr.Blocks(title="JNU-TSB") as demo: | |
| gr.Markdown("# JNU-TSB: ํ๊ตญ์ด ๋ด์ค ๊ธฐ๋ฐ Time-Series Bridge") | |
| gr.Markdown( | |
| "Chronos-2 + Polyglot-Ko + 3-way router ๊ตฌ์กฐ์ ๊ต์ก/์ฐ๊ตฌ์ฉ ๋ฐ๋ชจ์ ๋๋ค. " | |
| "์์ธก ๊ฒฐ๊ณผ๋ ํฌ์ ์กฐ์ธ์ด ์๋๋๋ค." | |
| ) | |
| with gr.Row(): | |
| stock_box = gr.Textbox(label="์ฃผ๊ฐ CSV", value=DEFAULT_STOCK, lines=9) | |
| news_box = gr.Textbox(label="๋ด์ค JSON", value=DEFAULT_NEWS, lines=9) | |
| with gr.Row(): | |
| pred_len = gr.Slider(label="์์ธก ๊ธธ์ด prediction_length", minimum=1, maximum=30, value=3, step=1) | |
| use_llm = gr.Checkbox(label="Polyglot-Ko ์ถ์ถ๊ธฐ ์ฌ์ฉ", value=False) | |
| btn = gr.Button("JNU-TSB ์คํ") | |
| out = gr.JSON(label="๊ฒฐ๊ณผ") | |
| btn.click(run_demo, inputs=[stock_box, news_box, pred_len, use_llm], outputs=out) | |
| if __name__ == "__main__": | |
| demo.launch() | |