Error when running a text classification task

Hello,

I am running a simple text classification task in three classes. My dataset has the correct format for this task: two columns (text, target). Both are containing string format data. My dataset seems to be valid and I already performed this task few weeks ago and every thing was working well.

Now I get this error:

File “/app/env/lib/python3.10/site-packages/autotrain/preprocessor/text.py”, line 83, in prepare
train_df[:, “autotrain_label”] = train_df[“autotrain_label”].astype(str)
File “/app/env/lib/python3.10/site-packages/pandas/core/frame.py”, line 4311, in setitem
self._set_item(key, value)
File “/app/env/lib/python3.10/site-packages/pandas/core/frame.py”, line 4527, in _set_item
key in self.columns
File “/app/env/lib/python3.10/site-packages/pandas/core/indexes/base.py”, line 5358, in contains
hash(key)
TypeError: unhashable type: ‘slice’

I feed the Auto Train with a .csv file. I tried several times several days and all I get is this error. The data is like below:

text,target
Global Stocks and Commodities Rally on First Trading Day of 2010,positive
Dollar Slumps Amid Worldwide Manufacturing Improvement,indecisive
…,…

Thank your very much for any help!

looks like your csv is not formatted properly. you can either format it properly (using pandas) or use jsonl format too.

Thanks for your answer. I follow exactly the guidelines provided here https://huggingface.co/docs/autotrain/text_classification#columns.

My dataset is containing two columns: text and target. Both are string type.

It already worked few weeks ago with the exact same dataset. Can it be a huggingface library new version error?

1 Like

To provide more insights about the situation. When using the autotrain-advanced library the fine-tuning runs correctly. When using the web interface I get this error. It seems that it comes from a recent update on the huggingface’s side.

can you share the dataset on autotrain@hf.co?

I just sent it.

Same error, I even published it a few days ago, some lib in the container seems to have broken the slice.

fixed in v0.7.57+

Where are the images from previous versions if I want to use them?

I think you can directly specify the pip image your want.