Skip to content

Conversation

@Rocketknight1
Copy link
Member

This PR is doing exactly the same thing as the notebooks PR here.

In our TF examples, we use return_tensors="tf" for the data collators. However, prepare_tf_dataset and to_tf_dataset actually use a NumPy loader internally, which we wrap with a tf.data.Dataset at the end. As a result, return_tensors="np" works much better for them, and avoids some weird slowdown bugs we've experienced.

This PR replaces every instance in our examples with return_tensors="np". (cc @gante, @amyeroberts, @sayakpaul just so you're aware)

@Rocketknight1 Rocketknight1 requested a review from sgugger January 23, 2023 17:23
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jan 23, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

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