Train end-to-end text classication on sagemaker
hi,I’m following the guidence on training text-classfication using my own dataset,refer tonotebooks/sagemaker-notebook.ipynb at master · huggingface/notebooks · GitHubI have two questions:should the dataset contain label column only support int? in other words, I need to preprocess my data, convert categories to 1,2,3…?do I need to specify the class number? if so, where?thanks!jackie
2021-10-08T11:10:41Z
Hey@jackieliu930,Yes, the labels need to be int valuesYes you need to modify the.from_pretrainedmethod here:notebooks/train.py at 3fdb8bd61ed2f2b499dcd55034b1ee58be5cfabb · huggingface/notebooks · GitHubYou could also use therun_glue.pyfromexamplesusing thegit_configthen you don’t need to provide your own training script.
2021-10-11T03:04:12Z
got it! super thanks! btw, I am wondering, why it seems that, with same parameter setting (epoch/ batch size), on same dataset, it appears that OOM happens when I use huggingfaceXsagemaker sdk, while works well with original pytorch sdk?any clue on this one?
2021-10-11T06:34:24Z
Nice!Did you use the same model, same dataset, same epoch & batch_size for train and eval, same instance type?
2021-10-11T06:44:08Z
yes. totally the same.
2021-10-11T06:58:12Z
Also same Pytorch and Transformers version?