# Autotrain ORPO Error 500

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fautotrain-orpo-error-500%2F110793%3E%5C
**Category:** Beginners\
**Created:** [October 8, 2024, 9:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fautotrain-orpo-error-500%2F110793 "2024-10-08T21:32:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![QuestforAIEd](https://avatars.discourse-cdn.com/v4/letter/q/67e7ee/32.png) [@QuestforAIEd](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FQuestforAIEd)%5C
**Post date:** [October 8, 2024, 9:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fautotrain-orpo-error-500%2F110793%2F1 "2024-10-08T21:32:49Z")

</div>

Hi everyone!

I am currently trying to fine-tune the Llama 3.1 8B Instruct model using ORPO.  
Unfortunately, I receive a 500 error (see below the Logs).

_Settings_

- LLM ORPO
- Standard Parameters (no changes made)
- Column mapping according to dataset (i.e. prompt, text, rejected\_text)
- Upload of local CSV file

_What I tried_

- Changing the “wrapping” of my raw text according to the example datasets ([trl-lib/ultrafeedback\_binarized · Datasets at Hugging Face](https://huggingface.co/datasets/trl-lib/ultrafeedback_binarized))
- Different wrappings
- Removing all commata from the CSV file, to prevent accidental column-recognition
- Different settings

A single prompt-text-rejected\_text-set might look like this:

| prompt | text | rejected\_text |
| --- | --- | --- |
| Wie beeinflusst die Salzkonzentration im Boden das Wachstum von Pflanzen? | Welche Pflanzenarten untersuchen Sie und wie werden Sie die Salzkonzentration und das Wachstum messen? | Salz ist generell schlecht für Pflanzen also wird das Wachstum gehemmt. |

I am fairly new to this, perhaps someone has an idea how to go forward to be able to fine-tune the model using ORPO? Might it have to do with using German language in the training set?

Cheers!  
P.s.: Does someone know how to delete the logs to clean it up after a test? 😃

KeyError: ‘text’

raise KeyError(key) from err

File “/app/env/lib/python3.10/site-packages/pandas/core/indexes/base.py”, line 3812, in get\_loc

indexer = self.columns.get\_loc(key)

File “/app/env/lib/python3.10/site-packages/pandas/core/frame.py”, line 4102, in **getitem**

train\_df.loc[:, “autotrain\_text”] = train\_df[self.text\_column]

File “/app/env/lib/python3.10/site-packages/autotrain/preprocessor/text.py”, line 293, in prepare\_columns

train\_df, valid\_df = self.prepare\_columns(train\_df, valid\_df)

File “/app/env/lib/python3.10/site-packages/autotrain/preprocessor/text.py”, line 311, in prepare

return preprocessor.prepare()

File “/app/env/lib/python3.10/site-packages/autotrain/dataset.py”, line 570, in prepare

data\_path = dset.prepare()

File “/app/env/lib/python3.10/site-packages/autotrain/app/ui\_routes.py”, line 645, in handle\_form

return await dependant.call(\*\*values)

File “/app/env/lib/python3.10/site-packages/fastapi/routing.py”, line 191, in run\_endpoint\_function

raw\_response = await run\_endpoint\_function(

File “/app/env/lib/python3.10/site-packages/fastapi/routing.py”, line 278, in app

response = await func(request)

File “/app/env/lib/python3.10/site-packages/starlette/routing.py”, line 72, in app

await app(scope, receive, sender)

File “/app/env/lib/python3.10/site-packages/starlette/\_exception\_handler.py”, line 53, in wrapped\_app

raise exc

File “/app/env/lib/python3.10/site-packages/starlette/\_exception\_handler.py”, line 64, in wrapped\_app

await wrap\_app\_handling\_exceptions(app, request)(scope, receive, send)

File “/app/env/lib/python3.10/site-packages/starlette/routing.py”, line 77, in app

await self.app(scope, receive, send)

File “/app/env/lib/python3.10/site-packages/starlette/routing.py”, line 297, in handle

await route.handle(scope, receive, send)

File “/app/env/lib/python3.10/site-packages/starlette/routing.py”, line 776, in app

await self.middleware\_stack(scope, receive, send)

File “/app/env/lib/python3.10/site-packages/starlette/routing.py”, line 756, in **call**

await app(scope, receive, sender)

File “/app/env/lib/python3.10/site-packages/starlette/\_exception\_handler.py”, line 53, in wrapped\_app

raise exc

File “/app/env/lib/python3.10/site-packages/starlette/\_exception\_handler.py”, line 64, in wrapped\_app

await wrap\_app\_handling\_exceptions(self.app, conn)(scope, receive, send)

File “/app/env/lib/python3.10/site-packages/starlette/middleware/exceptions.py”, line 65, in **call**

await self.app(scope, receive, send\_wrapper)

File “/app/env/lib/python3.10/site-packages/starlette/middleware/sessions.py”, line 85, in **call**

await self.app(scope, receive, \_send)

File “/app/env/lib/python3.10/site-packages/starlette/middleware/errors.py”, line 164, in **call**

raise exc

File “/app/env/lib/python3.10/site-packages/starlette/middleware/errors.py”, line 186, in **call**

await self.middleware\_stack(scope, receive, send)

File “/app/env/lib/python3.10/site-packages/starlette/applications.py”, line 123, in **call**

await super(). **call** (scope, receive, send)

File “/app/env/lib/python3.10/site-packages/fastapi/applications.py”, line 1054, in **call**

return await self.app(scope, receive, send)

File “/app/env/lib/python3.10/site-packages/uvicorn/middleware/proxy\_headers.py”, line 69, in **call**

result = await app( # type: ignore[func-returns-value]

File “/app/env/lib/python3.10/site-packages/uvicorn/protocols/http/httptools\_impl.py”, line 411, in run\_asgi

Traceback (most recent call last):

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

KeyError: ‘text’

File “pandas/\_libs/hashtable\_class\_helper.pxi”, line 7089, in pandas.\_libs.hashtable.PyObjectHashTable.get\_item

File “pandas/\_libs/hashtable\_class\_helper.pxi”, line 7081, in pandas.\_libs.hashtable.PyObjectHashTable.get\_item

File “index.pyx”, line 196, in pandas.\_libs.index.IndexEngine.get\_loc

File “index.pyx”, line 167, in pandas.\_libs.index.IndexEngine.get\_loc

return self.\_engine.get\_loc(casted\_key)

File “/app/env/lib/python3.10/site-packages/pandas/core/indexes/base.py”, line 3805, in get\_loc

Traceback (most recent call last):

ERROR: Exception in ASGI application

INFO | 2024-10-08 21:29:58 | autotrain.app.ui\_routes:handle\_form:629 - Column mapping: {‘prompt’: ‘prompt’, ‘text’: ‘text’, ‘rejected\_text’: ‘rejected\_text’}

INFO | 2024-10-08 21:29:58 | autotrain.app.ui\_routes:handle\_form:628 - Task: lm\_training

INFO | 2024-10-08 21:29:58 | autotrain.app.ui\_routes:handle\_form:500 - hardware: local-ui

INFO | 2024-10-08 21:29:28 | autotrain.app.ui\_routes:fetch\_params:391 - Param distributed\_backend not found in UI\_PARAMS

INFO | 2024-10-08 21:29:28 | autotrain.app.ui\_routes:fetch\_params:381 - Task: llm:orpo

INFO | 2024-10-08 21:29:26 | autotrain.app.ui\_routes:fetch\_params:391 - Param distributed\_backend not found in UI\_PARAMS

INFO | 2024-10-08 21:29:26 | autotrain.app.ui\_routes:fetch\_params:381 - Task: llm:sft

INFO: 10.16.3.138:58147 - “GET / HTTP/1.1” 307 Temporary Redirect

INFO: 10.16.3.138:58147 - “GET / HTTP/1.1” 307 Temporary Redirect

INFO: Uvicorn running on [http://0.0.0.0:7860](http://0.0.0.0:7860) (Press CTRL+C to quit)

INFO: Application startup complete.

INFO: Waiting for application startup.

INFO: Started server process [73]

INFO | 2024-10-08 21:29:24 | autotrain.app.app::24 - AutoTrain started successfully

INFO | 2024-10-08 21:29:24 | autotrain.app.app::23 - AutoTrain version: 0.8.21

INFO | 2024-10-08 21:29:24 | autotrain.app.app::13 - Starting AutoTrain…

INFO | 2024-10-08 21:29:24 | autotrain.app.ui\_routes::298 - AutoTrain started successfully

INFO | 2024-10-08 21:29:22 | autotrain.app.ui\_routes::32 - Starting AutoTrain…

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [October 9, 2024, 8:13am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fautotrain-orpo-error-500%2F110793%2F2 "2024-10-09T08:13:28Z")

</div>

I don’t know if this will help, but I found an article that might be helpful.

> **[Fine-tune Llama 3 with ORPO](https://huggingface.co/blog/mlabonne/orpo-llama-3)**
>
> A Blog post by Maxime Labonne on Hugging Face

> **[mlabonne/OrpoLlama-3-8B · Hugging Face](https://huggingface.co/mlabonne/OrpoLlama-3-8B)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

<div class="post-metadata">

**Author:** ![QuestforAIEd](https://avatars.discourse-cdn.com/v4/letter/q/67e7ee/32.png) [@QuestforAIEd](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FQuestforAIEd)%5C
**Post date:** [October 9, 2024, 9:14am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fautotrain-orpo-error-500%2F110793%2F3 "2024-10-09T09:14:17Z")

</div>

Thanks John,  
I had hoped to skip the coding part - and read this article a few weeks ago as well. Probably will just go back to this 😉

Thanks for your effort 🙂
