huggingface / autotrain-advanced

🤗 AutoTrain Advanced
https://huggingface.co/autotrain
Apache License 2.0
3.65k stars 442 forks source link

[BUG] Fine-tuning LLMs for text classification task #592

Closed blefo closed 2 months ago

blefo commented 2 months ago

Prerequisites

Backend

Hugging Face Space/Endpoints

Interface Used

UI

CLI Command

No response

UI Screenshots & Parameters

Hi,

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 is valid as I already performed this task few weeks ago and every thing was working well.

The parameters are these ones: Capture

Now I get this error: Capture

I already started this discussion on the HF forum: https://discuss.huggingface.co/t/error-when-running-a-text-classification-task/83051

Thanks for your help.

Error Logs

INFO | 2024-04-23 07:25:53 | autotrain.app:fetch_params:206 - Task: llm:sft INFO | 2024-04-23 07:26:04 | autotrain.app:fetch_params:206 - Task: text-classification INFO | 2024-04-23 07:26:10 | autotrain.app:handle_form:435 - hardware: Local INFO | 2024-04-23 07:26:10 | autotrain.app:handle_form:524 - Task: text_multi_class_classification INFO | 2024-04-23 07:26:10 | autotrain.app:handle_form:525 - Column mapping: {'text': 'text', 'label': 'target'} ERROR: Exception in ASGI application Traceback (most recent call last): File "/app/env/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi result = await app( # type: ignore[func-returns-value] File "/app/env/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call return await self.app(scope, receive, send) File "/app/env/lib/python3.10/site-packages/fastapi/applications.py", line 1106, in call await super().call(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in call raise exc File "/app/env/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in call await self.app(scope, receive, _send) File "/app/env/lib/python3.10/site-packages/starlette/middleware/sessions.py", line 86, in call await self.app(scope, receive, send_wrapper) File "/app/env/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call raise exc File "/app/env/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call await self.app(scope, receive, sender) File "/app/env/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call raise e File "/app/env/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call await self.app(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/routing.py", line 718, in call await route.handle(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle await self.app(scope, receive, send) File "/app/env/lib/python3.10/site-packages/starlette/routing.py", line 66, in app response = await func(request) File "/app/env/lib/python3.10/site-packages/fastapi/routing.py", line 274, in app raw_response = await run_endpoint_function( File "/app/env/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function return await dependant.call(**values) File "/app/env/lib/python3.10/site-packages/autotrain/app.py", line 541, in handle_form data_path = dset.prepare() File "/app/env/lib/python3.10/site-packages/autotrain/dataset.py", line 275, in prepare return preprocessor.prepare() 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'

Additional Information

No response

abhishekkrthakur commented 2 months ago

fixed in version 0.7.57+. please let me know if this is still an issue.