Value Error when instantiating MultiClass Classifier
Here is the code I am using:model = ClassificationModel('roberta', 'roberta-base', num_labels=37, args={'learning_rate':1e-5, 'num_train_epochs':10, 'reprocess_input_data':True})Here is the error it generates:---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-16-affadfcfb25e> in <module>
      1 #Need to figure out how many labels in os data
----> 2 model = ClassificationModel('roberta', 'roberta-base', num_labels=37, args={'learning_rate':1e-5, 'num_train_epochs':10, 'reprocess_input_data':True})

~\Anaconda3\lib\site-packages\simpletransformers\classification\classification_model.py in __init__(self, model_type, model_name, tokenizer_type, tokenizer_name, num_labels, weight, args, use_cuda, cuda_device, onnx_execution_provider, **kwargs)
    334 
    335         if num_labels:
--> 336             self.config = config_class.from_pretrained(
    337                 model_name, num_labels=num_labels, **self.args.config
    338             )

~\Anaconda3\lib\site-packages\transformers\configuration_utils.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
    425 
    426         """
--> 427         config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
    428         if "model_type" in config_dict and hasattr(cls, "model_type") and config_dict["model_type"] != cls.model_type:
    429             logger.warn(

~\Anaconda3\lib\site-packages\transformers\configuration_utils.py in get_config_dict(cls, pretrained_model_name_or_path, **kwargs)
    482         try:
    483             # Load from URL or cache if already cached
--> 484             resolved_config_file = cached_path(
    485                 config_file,
    486                 cache_dir=cache_dir,

~\Anaconda3\lib\site-packages\transformers\file_utils.py in cached_path(url_or_filename, cache_dir, force_download, proxies, resume_download, user_agent, extract_compressed_file, force_extract, use_auth_token, local_files_only)
   1269     if is_remote_url(url_or_filename):
   1270         # URL, so get it from the cache (downloading if necessary)
-> 1271         output_path = get_from_cache(
   1272             url_or_filename,
   1273             cache_dir=cache_dir,

~\Anaconda3\lib\site-packages\transformers\file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, use_auth_token, local_files_only)
   1492                     )
   1493                 else:
-> 1494                     raise ValueError(
   1495                         "Connection error, and we cannot find the requested files in the cached path."
   1496                         " Please try again or make sure your Internet connection is on."

ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.What can I do to resolve this issue?
2021-05-20T12:12:42Z
hey@parkzyour issue seems to be about thesimpletransformerslibrary (nottransformers) so i suggest you post you question on their repo to see if someone can help:GitHub - ThilinaRajapakse/simpletransformers: Transformers for Classification, NER, QA, Language Modelling, Language Generation, T5, Multi-Modal, and Conversational AI
2021-05-20T12:23:50Z
Is there a guide to setting up a multiclass with transformers?
2021-05-20T12:27:44Z
yes, there’s an official guide for text classification here:🤗 Transformers Notebooks — transformers 4.5.0.dev0 documentationin that notebook you can see how the number of labels is specified in the model config and you could try adapting this code to your use case