-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Bug]: Challenges in running TUTORIAL_10_TRAINING_ZERO_SHOT_MODEL #3305
Comments
Hi @None-Such Given that the error states that it is looking for the model |
Hi @helpmefindaname , Full Stack Trace is below (after processing output that raised it) 2023-09-19 15:52:32,783 https://cogcomp.seas.upenn.edu/Data/QA/QC/train_5500.label not found in cache, downloading to C:\Users\ADMINI 2023-09-19 15:52:33,595 https://cogcomp.seas.upenn.edu/Data/QA/QC/TREC_10.label not found in cache, downloading to C:\Users\ADMINI 2023-09-19 15:52:34,708 Initialized corpus C:\Users\Administrator.flair\datasets\trec_6 (label type name is 'question_class') 2023-09-19 15:52:37,650 TARS initialized without a task. You need to call .add_and_switch_to_new_task() before training this model 2023-09-19 16:15:30,575 ---------------------------------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\requests\models.py:1021, in Response.raise_for_status(self) HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/None/resolve/main/tokenizer_config.json The above exception was the direct cause of the following exception: RepositoryNotFoundError Traceback (most recent call last) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\huggingface_hub\utils_validators.py:120, in validate_hf_hub_args.._inner_fn(*args, **kwargs) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\huggingface_hub\file_download.py:1195, in hf_hub_download(repo_id, filename, subfolder, repo_type, revision, library_name, library_version, cache_dir, local_dir, local_dir_use_symlinks, user_agent, force_download, force_filename, proxies, etag_timeout, resume_download, token, local_files_only, legacy_cache_layout) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\huggingface_hub\utils_validators.py:120, in validate_hf_hub_args.._inner_fn(*args, **kwargs) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\huggingface_hub\file_download.py:1541, in get_hf_file_metadata(url, token, proxies, timeout) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\huggingface_hub\utils_errors.py:291, in hf_raise_for_status(response, endpoint_name) RepositoryNotFoundError: 401 Client Error. (Request ID: Root=1-6509c923-47a65d870f7fa63e1302ab90) Repository Not Found for url: https://huggingface.co/None/resolve/main/tokenizer_config.json. During handling of the above exception, another exception occurred: OSError Traceback (most recent call last) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\trainers\trainer.py:893, in ModelTrainer.train(self, base_path, learning_rate, mini_batch_size, eval_batch_size, mini_batch_chunk_size, max_epochs, train_with_dev, train_with_test, monitor_train, monitor_test, main_evaluation_metric, scheduler, anneal_factor, patience, min_learning_rate, initial_extra_patience, optimizer, cycle_momentum, warmup_fraction, embeddings_storage_mode, checkpoint, save_final_model, anneal_with_restarts, anneal_with_prestarts, anneal_against_dev_loss, batch_growth_annealing, shuffle, param_selection_mode, write_weights, num_workers, sampler, use_amp, amp_opt_level, eval_on_train_fraction, eval_on_train_shuffle, save_model_each_k_epochs, tensorboard_comment, use_swa, use_final_model_for_eval, gold_label_dictionary_for_eval, exclude_labels, create_file_logs, create_loss_file, epoch, use_tensorboard, tensorboard_log_dir, metrics_for_tensorboard, optimizer_state_dict, scheduler_state_dict, save_optimizer_state, reduce_transformer_vocab, shuffle_first_epoch, **kwargs) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\trainers\trainer.py:1015, in ModelTrainer.final_test(self, base_path, eval_mini_batch_size, main_evaluation_metric, num_workers, gold_label_dictionary_for_eval, exclude_labels) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\models\tars_model.py:928, in TARSClassifier.load(cls, model_path) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\models\tars_model.py:323, in FewshotClassifier.load(cls, model_path) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\nn\model.py:559, in Classifier.load(cls, model_path) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\nn\model.py:191, in Model.load(cls, model_path) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\file_utils.py:359, in load_torch_state(model_file) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\torch\serialization.py:809, in load(f, map_location, pickle_module, weights_only, **pickle_load_args) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\torch\serialization.py:1172, in _load(zip_file, map_location, pickle_module, pickle_file, **pickle_load_args) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\embeddings\transformer.py:1162, in TransformerEmbeddings.setstate(self, state) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\embeddings\document.py:61, in TransformerDocumentEmbeddings.create_from_state(cls, **state) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\embeddings\document.py:47, in TransformerDocumentEmbeddings.init(self, model, layers, layer_mean, is_token_embedding, **kwargs) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\flair\embeddings\transformer.py:966, in TransformerEmbeddings.init(self, model, fine_tune, layers, layer_mean, subtoken_pooling, cls_pooling, is_token_embedding, is_document_embedding, allow_long_sentences, use_context, respect_document_boundaries, context_dropout, saved_config, tokenizer_data, feature_extractor_data, name, force_max_length, needs_manual_ocr, use_context_separator, **kwargs) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\transformers\models\auto\tokenization_auto.py:643, in AutoTokenizer.from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\transformers\models\auto\tokenization_auto.py:487, in get_tokenizer_config(pretrained_model_name_or_path, cache_dir, force_download, resume_download, proxies, use_auth_token, revision, local_files_only, subfolder, **kwargs) File C:\ProgramData\miniconda3\envs\flair-v12.2-env-v3\lib\site-packages\transformers\utils\hub.py:433, in cached_file(path_or_repo_id, filename, cache_dir, force_download, resume_download, proxies, use_auth_token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash) OSError: None is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models' |
Thanks for taking a look at this =) Please let me know if you need anything else, Regards, Christopher |
Hi @None-Such I'm sorry for the late response.
after loading the model |
Thanks so much for your reply. That indeed got me past the previous error. =) But unfortunately, I am now stuck on a different error in the next step of the same Tutorial: How to train with multiple datasets
. . .
. . .
|
@None-Such as the error message says: |
Hi @helpmefindaname , Thanks for your patience with my superior ability to ignore the obvious ;) Adding the environment variable has the effect of letting the step in question run all the way through . . . without visible error ! So now I am able to run the entire Tutorial =) Running with a slightly modified environment However, in the interest of full disclosure, I was running with a slightly modified environment. The current default dependencies where not working for me at all. I found I had to regress to dependencies as listed below. Works
Does not Work
I will take another pass at trying to get the defaults to work and report back. |
Upon re-visiting the environment definition, I can not get the tutorial to work in anything newer than:
Otherwise, I am good to go. Thanks again your help. ps. I updated the Issue Title so it may be more likely to be of use to others |
Describe the bug
TUTORIAL_10_TRAINING_ZERO_SHOT_MODEL at Use Case 3: Train a TARS model step # 8 raises following error:
How should one add there HuggingFace Token? Or is this a misleading error?
To Reproduce
Expected behavior
Model should train & save without raising error
Logs and Stack traces
Screenshots
No response
Additional Context
No response
Environment
Versions:
Flair
0.12.2
Pytorch
2.0.1
Transformers
4.29.2
GPU
True
The text was updated successfully, but these errors were encountered: