Skip to content

allow Load offline, expose local path#39

Merged
laurahanu merged 8 commits into
unitaryai:masterfrom
Lightning-Sandbox:load-offline
Jan 14, 2022
Merged

allow Load offline, expose local path#39
laurahanu merged 8 commits into
unitaryai:masterfrom
Lightning-Sandbox:load-offline

Conversation

@Borda

@Borda Borda commented Nov 29, 2021

Copy link
Copy Markdown
Contributor

Resolves #34. propagate exposing the local path to the contractor...

@Borda Borda changed the title allw Load offline allow Load offline, expose local path Nov 29, 2021
@Borda

Borda commented Nov 29, 2021

Copy link
Copy Markdown
Contributor Author

@laurahanu laurahanu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR, sounds like this might be useful to have!

Since the things that are being downloaded by HF are only tokenizer related (e.g. tokenizer.json, tokenizer_config.json, vocab.txt, config.json) we should probably rename this to tokenizer_path and add it to the docstring too.

Comment thread detoxify/detoxify.py Outdated
Comment thread detoxify/detoxify.py Outdated
Comment thread detoxify/detoxify.py Outdated
@Borda Borda requested a review from laurahanu December 7, 2021 21:26
@Borda Borda requested a review from jamt9000 December 30, 2021 13:51
@Borda

Borda commented Dec 30, 2021

Copy link
Copy Markdown
Contributor Author

@laurahanu all resolved as you requested 🐰

@laurahanu

Copy link
Copy Markdown
Collaborator

Great, thanks! Although, would still be good to change pretrained_model_path to transformers_offline_files_path or required_offline_files_path or something that suggests it doesn't need the model weights

@Borda

Borda commented Dec 30, 2021

Copy link
Copy Markdown
Contributor Author

Great, thanks! Although, would still be good to change pretrained_model_path to transformers_offline_files_path or required_offline_files_path or something that suggests it doesn't need the model weights

not sure if I understand... to be able to run it offline you need to download the same files existing in the hub, but you wanted to rename the argument differently? if you really wish you you can do this edit in PR but I am not much happy about raising this confusion for user :/

@laurahanu

Copy link
Copy Markdown
Collaborator

Yes, since the files needed are only the config and tokenizer files, it seems more confusing if the variable is named pretrained_model_path when it is not intended as a path to the model weights. Especially when there is another argument, checkpoint, that is intended as that.

Also, would be good to add the new variable to the main class docstring too.

@Borda

Borda commented Dec 30, 2021

Copy link
Copy Markdown
Contributor Author

@laurahanu done

@laurahanu

Copy link
Copy Markdown
Collaborator

Great, thank you!

One last thing, would be great if we could mention in the docstring that this is needed for offline model loading, something like:

huggingface_config_path: path to HF config and tokenizer files needed for offline model loading

Comment thread detoxify/detoxify.py Outdated
@Borda

Borda commented Dec 30, 2021

Copy link
Copy Markdown
Contributor Author

@laurahanu done

@jamt9000 jamt9000 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for your contributions and happy new year!

(Windows failure should be fixed by other pr)

@Borda

Borda commented Jan 4, 2022

Copy link
Copy Markdown
Contributor Author

(Windows failure should be fixed by other pr)

it is fixed over here #40

@Borda

Borda commented Jan 12, 2022

Copy link
Copy Markdown
Contributor Author

@jamt9000 @laurahanu could we merge it? 🐰

@laurahanu laurahanu merged commit 52f623b into unitaryai:master Jan 14, 2022
@Borda Borda deleted the load-offline branch January 14, 2022 11:43
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.

allow full offline execution

3 participants