KeyError: 'text' issue using AutoTrain Advanced with Mixtral-8X7B-Instruct-v0.1 model

I have using the AutoTrain Advanced UI feature for training the Mixtral-8X7B-Instruct-v0.1 model. I have used JSONL file format for loading my training data. It has format as:

{“text”: “### Question: … ### Answer: …”}

All looks good but still, I am facing the following error on the console:

INFO: - "POST /create_project HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/app/env/lib/python3.10/site-packages/pandas/core/indexes/", line 3791, in get_loc
    return self._engine.get_loc(casted_key)
  File "index.pyx", line 152, in pandas._libs.index.IndexEngine.get_loc
  File "index.pyx", line 181, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 7080, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'text'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/env/lib/python3.10/site-packages/uvicorn/protocols/http/", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/app/env/lib/python3.10/site-packages/uvicorn/middleware/", line 78, in __call__
    return await, receive, send)
  File "/app/env/lib/python3.10/site-packages/fastapi/", line 1106, in __call__
    await super().__call__(scope, receive, send)
  File "/app/env/lib/python3.10/site-packages/starlette/", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/env/lib/python3.10/site-packages/starlette/middleware/", line 184, in __call__
    raise exc
  File "/app/env/lib/python3.10/site-packages/starlette/middleware/", line 162, in __call__
    await, receive, _send)
  File "/app/env/lib/python3.10/site-packages/starlette/middleware/", line 79, in __call__
    raise exc
  File "/app/env/lib/python3.10/site-packages/starlette/middleware/", line 68, in __call__
    await, receive, sender)
  File "/app/env/lib/python3.10/site-packages/fastapi/middleware/", line 20, in __call__
    raise e
  File "/app/env/lib/python3.10/site-packages/fastapi/middleware/", line 17, in __call__
    await, receive, send)
  File "/app/env/lib/python3.10/site-packages/starlette/", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/app/env/lib/python3.10/site-packages/starlette/", line 276, in handle
    await, receive, send)
  File "/app/env/lib/python3.10/site-packages/starlette/", line 66, in app
    response = await func(request)
  File "/app/env/lib/python3.10/site-packages/fastapi/", line 274, in app
    raw_response = await run_endpoint_function(
  File "/app/env/lib/python3.10/site-packages/fastapi/", line 191, in run_endpoint_function
    return await**values)
  File "/app/src/autotrain/", line 414, in handle_form
    data_path = dset.prepare()
  File "/app/src/autotrain/", line 324, in prepare
    return preprocessor.prepare()
  File "/app/src/autotrain/preprocessor/", line 204, in prepare
    train_df, valid_df = self.prepare_columns(train_df, valid_df)
  File "/app/src/autotrain/preprocessor/", line 186, in prepare_columns
    train_df.loc[:, "autotrain_text"] = train_df[self.text_column]
  File "/app/env/lib/python3.10/site-packages/pandas/core/", line 3893, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/app/env/lib/python3.10/site-packages/pandas/core/indexes/", line 3798, in get_loc
    raise KeyError(key) from err
KeyError: 'text'

I am using these settings:

I have tried multiple points but have not been able to find the solution.

Thanks in advance!!

you need to use csv. jsonl is not supported. AutoTrain

1 Like

Thank you!! I think now it’s working with CSV format. Thanks again for your prompt response.