Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,30 @@ wav = model.generate(text, audio_prompt_path=AUDIO_PROMPT_PATH)
ta.save("test-2.wav", wav, model.sr)`,
];

export const chronos_forecasting = (model: ModelData): string[] => {
const installSnippet = `pip install chronos-forecasting`;

const exampleSnippet = `import pandas as pd
from chronos import BaseChronosPipeline

pipeline = BaseChronosPipeline.from_pretrained("${model.id}", device_map="cuda")

# Load historical data
context_df = pd.read_csv("https://autogluon.s3.us-west-2.amazonaws.com/datasets/timeseries/misc/AirPassengers.csv")

# Generate predictions
pred_df = pipeline.predict_df(
context_df,
prediction_length=36, # Number of steps to forecast
quantile_levels=[0.1, 0.5, 0.9], # Quantiles for probabilistic forecast
id_column="item_id", # Column identifying different time series
timestamp_column="Month", # Column with datetime information
target="#Passengers", # Column(s) with time series values to predict
)`;

return [installSnippet, exampleSnippet];
};

export const contexttab = (): string[] => {
const installSnippet = `pip install git+https://github.com/SAP-samples/contexttab`;

Expand Down
7 changes: 7 additions & 0 deletions packages/tasks/src/model-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
repoUrl: "https://github.com/Unbabel/COMET/",
countDownloads: `path:"hparams.yaml"`,
},
"chronos-forecasting": {
prettyLabel: "Chronos",
repoName: "chronos-forecasting",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
prettyLabel: "Chronos",
repoName: "chronos-forecasting",
prettyLabel: "Chronos Forecasting",
repoName: "Chronos Forecasting",

We are in the process of merging these 2 fields. Is Chronos Forecasting ok for you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chronos Forecasting works but I would slightly prefer just Chronos. Would that be okay?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes ofc!

repoUrl: "https://github.com/amazon-science/chronos-forecasting",
countDownloads: `path:"config.json"`,
snippets: snippets.chronos_forecasting,
},
contexttab: {
prettyLabel: "ConTextTab",
repoName: "ConTextTab",
Expand Down