You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The below error occurs when the y argument for BertFinetuneClassifier.fit() contains a datatype that is not JSON serializable, e.g., if a labeled dataset contains 0's and 1's as labels and they are converted to int64 in a Numpy array.
File "~/llm-tweet-classification/utils/finetune.py", line 44, in fit
self.model = AutoModelForSequenceClassification.from_pretrained(
File "~/llm-tweet-classification/venv/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 525, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
File "~/llm-tweet-classification/venv/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 1051, in from_pretrained
return config_class.from_dict(config_dict, **unused_kwargs)
File "~/llm-tweet-classification/venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 775, in from_dict
logger.info(f"Model config {config}")
File "~/llm-tweet-classification/venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 807, in __repr__
return f"{self.__class__.__name__} {self.to_json_string()}"
File "~/llm-tweet-classification/venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 918, in to_json_string
return json.dumps(config_dict, indent=2, sort_keys=True) + "\n"
File "/usr/lib/python3.10/json/__init__.py", line 238, in dumps
**kw).encode(obj)
File "/usr/lib/python3.10/json/encoder.py", line 201, in encode
chunks = list(chunks)
File "/usr/lib/python3.10/json/encoder.py", line 431, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/usr/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/usr/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
yield from chunks
File "/usr/lib/python3.10/json/encoder.py", line 438, in _iterencode
o = _default(o)
File "/usr/lib/python3.10/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type int64 is not JSON serializable
The text was updated successfully, but these errors were encountered:
The below error occurs when the
y
argument forBertFinetuneClassifier.fit()
contains a datatype that is not JSON serializable, e.g., if a labeled dataset contains 0's and 1's as labels and they are converted toint64
in a Numpy array.The text was updated successfully, but these errors were encountered: