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

Update to latest version of transformers #31

Merged
merged 28 commits into from
Mar 10, 2023

Conversation

akashsaravanan-georgian
Copy link
Contributor

Includes fixes to #9, #14, #29. Also potentially resolves #3, #7, #27, #28.

@jminnion
Copy link

jminnion commented Mar 7, 2023

One suggestion relevant to this PR (I'd be happy to create an issue for this if it would help):

Update multimodal_transformers/__init__.py line 4 (link to line) to update __version__

Same suggestion for setup.py line 3 (another __version__ variable there).

You folks are awesome, my team is attempting to use this branch/PR for our graduate degree capstone project, we're very appreciative of your work. Thank you!

@akashsaravanan-georgian
Copy link
Contributor Author

Hey @jminnion, thank you for pointing out the inconsistency there! I've fixed it.

Thank you for using our library :) We plan on merging this branch to main and publishing a new release soon.

@akashsaravanan-georgian akashsaravanan-georgian marked this pull request as ready for review March 8, 2023 18:37
Copy link

@truskovskiyk truskovskiyk left a comment

Choose a reason for hiding this comment

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

@akashsaravanan-georgian amazing work, please fix comments before merge

@@ -14,8 +14,8 @@
"num_train_epochs": 5,
"overwrite_output_dir": true,
"learning_rate": 3e-3,
"per_device_train_batch_size": 12,

Choose a reason for hiding this comment

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

why do we need this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was changed during a pass to standardize the training config formats across the different datasets. I modified the batch size from 12 -> 16 just to conform to the traditional approach of having the batch size be a power of 2.

@@ -1,24 +1,25 @@
{
"output_dir": "./logs_petfinder/",
"output_dir": "./logs_petfinder/gating_on_cat_and_num_feats_then_sum_full_model",

Choose a reason for hiding this comment

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

hm, why gating_on_cat_and_num_feats_then_sum_full_model ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The existing config utilized this. The name is just a reference to the method used to combine the different embeddings obtained from the model. I just standardized the format in which the output dir was named across the three configs.

"tokenizer_name": "bert-base-uncased",
"per_device_train_batch_size": 12,
"use_simple_classifier": false,
"logging_dir": "./logs_clothing_review/bertbase_gating_on_cat_and_num_feats_then_sum_full_model_lr_3e-3/",

Choose a reason for hiding this comment

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

is it possible to avoid hardcoded paths like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What would you suggest instead? These seem to be primarily intended to serve as examples for users more than anything else.

multimodal_exp_args.py Show resolved Hide resolved
multimodal_transformers/__init__.py Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
Comment on lines +27 to +41
CONFIGS = [
"./tests/test_airbnb.json",
"./tests/test_clothing.json",
"./tests/test_petfinder.json"
]

MODELS = [
"albert-base-v2",
"bert-base-multilingual-uncased",
"distilbert-base-uncased",
"roberta-base",
"xlm-mlm-100-1280",
"xlm-roberta-base",
"xlnet-base-cased"
]

Choose a reason for hiding this comment

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

try to use pytest fixture for this: https://docs.pytest.org/en/6.2.x/fixture.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if a fixture is the best option here. We have only one test function we're using. I was under the impression that we'd use a fixture when we have multiple tests that require similar inputs not when we have one test with several different inputs.

Copy link

@angeliney angeliney left a comment

Choose a reason for hiding this comment

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

Thank you for updating this repo, @akashsaravanan-georgian !! I just tried running the tests on mac and debian. Both work well with Python 3.10 💯

setup.py Outdated Show resolved Hide resolved
@akashsaravanan-georgian akashsaravanan-georgian merged commit c341715 into master Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment