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

Baal in Production Notebook | Classification | NLP | Hugging Face #245

Merged
merged 4 commits into from
Jan 28, 2023

Conversation

nitish1295
Copy link
Contributor

Summary:

This is a demo/tutorial to use active learning with hugging face models in a production setting. Kindly find more about this at in the discussion at #242

Features:

NA

Checklist:

  • Your code is documented (To validate this, add your module to tests/documentation_test.py).
  • Your code is tested with unit tests.
  • You moved your Issue to the PR state.

Given that this is a notebook and I am not setting up any new modules there are no test cases. There is some pending type hinting pending which I will complete.

Opening a PR for your feedback, just to check if you want me to add/remove somethings

Additional Info

Challenges with current GPU

Seems like the pytorch version which baal uses does not support my current GPU. Although I have tested this on Colab and it works fine.

NVIDIA GeForce RTX 3050 Laptop GPU with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
If you want to use the NVIDIA GeForce RTX 3050 Laptop GPU GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))

More info about this on the pytorch forum in case someone runs into a similar issue

import torch

torch.__version__

1.12.1+cu102

torch.cuda.get_arch_list()

['sm_37', 'sm_50', 'sm_60', 'sm_70']

Although I have tested this on Colab and it works fine.

Challenges with Black Formatting

You might want to update your black version to black==22.3.0.

The make format command produces an error which is identical to the one mentioned at stack overflow here.

I have encountered this before and an upgrade does fix it

@Dref360 Dref360 self-requested a review December 10, 2022 15:11
@Dref360
Copy link
Member

Dref360 commented Dec 11, 2022

Awesome!

I'll update torch/black in a PR separately.

My only comment would be around the csvs. Could we load the dataset directly from HuggingFace? load_datasets('tweet_eval", "emotion")?

Also if you can, could you add the new notebook to the documentation in mkdocs.yml? Maybe make a new subsection to hold all tutorials for production.

Very minor comments! Thank you very much.

@nitish1295
Copy link
Contributor Author

My only comment would be around the csvs. Could we load the dataset directly from HuggingFace? load_datasets('tweet_eval", "emotion")?

I had expected this but I had deliberately done this to "mimic" a setting where we do not load data directly via Hugging Face, but I guess people can do this on their own based on their requirements. Will update this.

Yes will do the docs thing

Copy link
Member

@Dref360 Dref360 left a comment

Choose a reason for hiding this comment

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

LGTM

@Dref360 Dref360 enabled auto-merge (squash) January 28, 2023 02:45
@Dref360 Dref360 merged commit 8413ea4 into baal-org:master Jan 28, 2023
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.

2 participants