Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Allow exporting decoder models using optimum-cli #422

Merged
merged 11 commits into from
Jan 25, 2024
Merged

Conversation

dacorvo
Copy link
Collaborator

@dacorvo dacorvo commented Jan 18, 2024

A long awaited feature ... it is now possible to export decoder models just like any other models using the optimum-cli.

@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.

@dacorvo dacorvo marked this pull request as ready for review January 18, 2024 16:20
Copy link
Member

@philschmid philschmid left a comment

Choose a reason for hiding this comment

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

Should be add a test for it?

@dacorvo
Copy link
Collaborator Author

dacorvo commented Jan 24, 2024

Should be add a test for it?

I thought I did add one, but I might have dreamed it, or I lost it in my rebase ...

@dacorvo
Copy link
Collaborator Author

dacorvo commented Jan 24, 2024

Should be add a test for it?

I thought I did add one, but I might have dreamed it, or I lost it in my rebase ...

Done.

docs/source/guides/export_model.mdx Outdated Show resolved Hide resolved
# If the sequence_length was not specified, deduce it from the model configuration
if sequence_length is None:
# Note: for older models, max_position_embeddings is an alias for n_positions
sequence_length = config.max_position_embeddings
if num_cores is None:
# Use all available cores
num_cores = len(os.listdir("/sys/class/neuron_device/")) * 2
Copy link
Member

Choose a reason for hiding this comment

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

This will fail if the directory does not exist. Are we sure that this code can only be executed on a machine that has neuron devices?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a check on top of the function. It is not possible to instantiate the transformers-neuronx model otherwise.

@dacorvo dacorvo merged commit 7d0dbb5 into main Jan 25, 2024
7 checks passed
@dacorvo dacorvo deleted the cli_export_decoders branch January 25, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants