Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TimesFM #2135

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

TimesFM #2135

wants to merge 6 commits into from

Conversation

kashif
Copy link

@kashif kashif commented Dec 22, 2024

What does this PR do?

Add support for TimesFM model

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Comment on lines 2544 to 2545
def outputs(self) -> Dict[str, Dict[int, str]]:
return super().outputs
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the error you are facing is because you haven't specified the names + shapes for the expected outputs:
image

i.e., mean_predictions and full_predictions (you can skip loss)

Copy link
Collaborator

Choose a reason for hiding this comment

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

added in 5c2fee5, thanks @xenova !

@@ -2629,6 +2629,51 @@ class EncoderDecoderOnnxConfig(EncoderDecoderBaseOnnxConfig):
DEFAULT_ONNX_OPSET = 14 # uses SDPA in Transformers, hence opset>=14.


class TimesFMDummyInputGenerator(DummyInputGenerator):
Copy link
Collaborator

Choose a reason for hiding this comment

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

could make sense to re-use DummyPatchTSTInputGenerator instead (with some extra modifications), let's wait for huggingface/transformers#34082 to be merged

Copy link
Author

Choose a reason for hiding this comment

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

@echarlaix one question i had about the huggingface/transformers#34082 in the timesfm_config i do not think my TimesFmOnnxConfig is correct... do you agree?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes it shouldn't inherit from OnnxSeq2SeqConfigWithPast (which should be used for the export of encoder-decoder models). I think you can directly remove TimesFmOnnxConfig in huggingface/transformers#34082 as it shouldn't be used anywhere from what I know (also I'm expecting anything onnx related to be deprecated in v5)

Copy link
Collaborator

Choose a reason for hiding this comment

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

in any case let me know if I can help @kashif

Copy link
Author

Choose a reason for hiding this comment

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

ok let me remove it... it would be good to then get it working via transformers.js... let me remove it first and then get back to you!

Copy link
Collaborator

Choose a reason for hiding this comment

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

sure thanks, also cc @michaelbenayoun @JingyaHuang @IlyasMoutawwakil who can take a look while I'm ooo

@kashif
Copy link
Author

kashif commented Mar 7, 2025

thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants