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

[Train] HuggingFacePredictor & docs improvements #30945

Merged
merged 4 commits into from
Dec 9, 2022

Conversation

Yard1
Copy link
Member

@Yard1 Yard1 commented Dec 7, 2022

Why are these changes needed?

This PR introduces 2 changes:

  • Removes a confusing suggestion in the docstring of HuggingFaceCheckpoint - checkpoints created using from_checkpoint will not work for prediction as intended.
  • Adds use_gpu argument and logic to automatically use GPU if one is available to HuggingFacePredictor.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Antoni Baum <[email protected]>
@Yard1 Yard1 requested a review from amogkam December 7, 2022 22:22
@Yard1 Yard1 marked this pull request as ready for review December 7, 2022 22:22
@Yard1 Yard1 requested a review from amogkam December 9, 2022 18:28
dataset = ray.data.from_numpy(prompts.to_numpy().astype("U"))
elif batch_type == pd.DataFrame:
dataset = ray.data.from_pandas(prompts)
elif batch_type == pa.Table:
Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove arrow if it's no longer being supported?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's in multiple tests - we should do this in a separate PR

Signed-off-by: Antoni Baum <[email protected]>
@Yard1 Yard1 requested a review from amogkam December 9, 2022 20:44
@amogkam amogkam merged commit 81237e0 into ray-project:master Dec 9, 2022
@Yard1 Yard1 deleted the hf_improvements branch December 10, 2022 17:48
WeichenXu123 pushed a commit to WeichenXu123/ray that referenced this pull request Dec 19, 2022
This PR introduces 2 changes:

Removes a confusing suggestion in the docstring of HuggingFaceCheckpoint - checkpoints created using from_checkpoint will not work for prediction as intended.
Adds use_gpu argument and logic to automatically use GPU if one is available to HuggingFacePredictor.

Signed-off-by: Antoni Baum <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
tamohannes pushed a commit to ju2ez/ray that referenced this pull request Jan 25, 2023
This PR introduces 2 changes:

Removes a confusing suggestion in the docstring of HuggingFaceCheckpoint - checkpoints created using from_checkpoint will not work for prediction as intended.
Adds use_gpu argument and logic to automatically use GPU if one is available to HuggingFacePredictor.

Signed-off-by: Antoni Baum <[email protected]>
Signed-off-by: tmynn <[email protected]>
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.

3 participants