# complete beginner - error 500 'templateresponse has no len () what does this mean?

**URL:** <https://discuss.huggingface.co/t/complete-beginner-error-500-templateresponse-has-no-len-what-does-this-mean/134314>\
**Category:** Beginners\
**Created:** [January 5, 2025, 9:12am UTC](https://discuss.huggingface.co/t/complete-beginner-error-500-templateresponse-has-no-len-what-does-this-mean/134314 "2025-01-05T09:12:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nmaf](https://avatars.discourse-cdn.com/v4/letter/n/9fc348/32.png) [@Nmaf](https://discuss.huggingface.co/u/Nmaf)\
**Post date:** [January 5, 2025, 9:12am UTC](https://discuss.huggingface.co/t/complete-beginner-error-500-templateresponse-has-no-len-what-does-this-mean/134314/1 "2025-01-05T09:12:25Z")

</div>

Complete beginner and I am trying to use autotrain’s text classification. I am using csv file format but keep getting 500 error with the log error 'template response has no len (). I’m unable to decipher the problem!? Any ideas on what I need to adjust?

INFO | 2025-01-04 21:00:08 | autotrain.app.ui\_routes:fetch\_params:415 - Task: llm:sft

INFO: 10.16.9.166:59649 - “GET /?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2Nzc3NjNmZTIwNGI3YzVkZTJhMDAzNGUiLCJ1c2VyIjoiTm1hZiJ9LCJpYXQiOjE3MzYwMjQ0MDYsInN1YiI6Ii9zcGFjZXMvTm1hZi9hdXRvdHJhaW4tYWR2YW5jZWQiLCJleHAiOjE3MzYxMTA4MDYsImlzcyI6Imh0dHBzOi8vaHVnZ2luZ2ZhY2UuY28ifQ.95TRLj-cQY63uRFT0TZ4xjxoNVMsPxhg2OQg1H076uHBabXIoFdRZR8wdNXQuTxuzJHaQRJcV0a3kAgjPb0JDA HTTP/1.1” 307 Temporary Redirect

ValueError: text not in train data

raise ValueError(f"{self.text\_column} not in train data")

File “/app/env/lib/python3.10/site-packages/autotrain/preprocessor/text.py”, line 61, in **post\_init**

File “”, line 14, in **init**

preprocessor = TextMultiClassClassificationPreprocessor(

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

data\_path = dset.prepare()

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

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

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

raw\_response = await run\_endpoint\_function(

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

response = await f(request)

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

await app(scope, receive, sender)

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

raise exc

File “/app/env/lib/python3.10/site-packages/starlette/\_exception\_handler.py”, line 53, 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 76, in app

await self.app(scope, receive, send)

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

await route.handle(scope, receive, send)

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

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

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

await app(scope, receive, sender)

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

raise exc

File “/app/env/lib/python3.10/site-packages/starlette/\_exception\_handler.py”, line 53, 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 62, 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 165, in **call**

raise exc

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

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

File “/app/env/lib/python3.10/site-packages/starlette/applications.py”, line 113, 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 60, in **call**

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

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

Traceback (most recent call last):

ERROR: Exception in ASGI application

INFO | 2025-01-04 20:59:13 | autotrain.app.ui\_routes:handle\_form:657 - Column mapping: {‘text’: ‘text’, ‘label’: ‘target’}

INFO | 2025-01-04 20:59:13 | autotrain.app.ui\_routes:handle\_form:656 - Task: text\_multi\_class\_classification

INFO | 2025-01-04 20:59:13 | autotrain.app.ui\_routes:handle\_form:540 - hardware: local-ui

INFO | 2025-01-04 20:58:07 | autotrain.app.ui\_routes:fetch\_params:415 - Task: text-classification

INFO | 2025-01-04 20:57:58 | autotrain.app.ui\_routes:fetch\_params:415 - Task: llm:sft

INFO: 10.16.9.166:25910 - “GET / HTTP/1.1” 307 Temporary Redirect

INFO: 10.16.24.150:4111 - “GET /auth?code=ZcNwZyvZeqEzeyBV&state=PU6eDlN6QbFYfARBsWfiLBBD76uaGv HTTP/1.1” 307 Temporary Redirect

INFO: 10.16.32.70:52910 - “GET /login/huggingface?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2Nzc3NjNmZTIwNGI3YzVkZTJhMDAzNGUiLCJ1c2VyIjoiTm1hZiJ9LCJpYXQiOjE3MzYwMjQyNjgsInN1YiI6Ii9zcGFjZXMvTm1hZi9hdXRvdHJhaW4tYWR2YW5jZWQiLCJleHAiOjE3MzYxMTA2NjgsImlzcyI6Imh0dHBzOi8vaHVnZ2luZ2ZhY2UuY28ifQ.-toeM5bqoVMJfe9IaxUgFO1P3mRqCxTF-TBNwcV07ASY9XImBqUCDjGSAwUnVhV5htUOPybOTZJ2jr4-8Y4IAQ HTTP/1.1” 302 Found

ERROR | 2025-01-04 20:57:48 | autotrain.app.ui\_routes:load\_index:381 - Failed to get user and orgs: object of type ‘\_TemplateResponse’ has no len()

INFO: 10.16.32.70:40208 - “GET /?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2Nzc3NjNmZTIwNGI3YzVkZTJhMDAzNGUiLCJ1c2VyIjoiTm1hZiJ9LCJpYXQiOjE3MzYwMjQyNjgsInN1YiI6Ii9zcGFjZXMvTm1hZi9hdXRvdHJhaW4tYWR2YW5jZWQiLCJleHAiOjE3MzYxMTA2NjgsImlzcyI6Imh0dHBzOi8vaHVnZ2luZ2ZhY2UuY28ifQ.-toeM5bqoVMJfe9IaxUgFO1P3mRqCxTF-TBNwcV07ASY9XImBqUCDjGSAwUnVhV5htUOPybOTZJ2jr4-8Y4IAQ HTTP/1.1” 307 Temporary Redirect

INFO: 10.16.9.166:58312 - “GET /?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2Nzc3NjNmZTIwNGI3YzVkZTJhMDAzNGUiLCJ1c2VyIjoiTm1hZiJ9LCJpYXQiOjE3MzYwMjQyNjgsInN1YiI6Ii9zcGFjZXMvTm1hZi9hdXRvdHJhaW4tYWR2YW5jZWQiLCJleHAiOjE3MzYxMTA2NjgsImlzcyI6Imh0dHBzOi8vaHVnZ2luZ2ZhY2UuY28ifQ.-toeM5bqoVMJfe9IaxUgFO1P3mRqCxTF-TBNwcV07ASY9XImBqUCDjGSAwUnVhV5htUOPybOTZJ2jr4-8Y4IAQ HTTP/1.1” 307 Temporary Redirect

ERROR | 2025-01-04 20:55:49 | autotrain.app.ui\_routes:load\_index:381 - Failed to get user and orgs: object of type ‘\_TemplateResponse’ has no len()

INFO: 10.16.32.70:25053 - “GET /?logs=container&\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2Nzc3NjNmZTIwNGI3YzVkZTJhMDAzNGUiLCJ1c2VyIjoiTm1hZiJ9LCJpYXQiOjE3MzYwMjQxNDcsInN1YiI6Ii9zcGFjZXMvTm1hZi9hdXRvdHJhaW4tYWR2YW5jZWQiLCJleHAiOjE3MzYxMTA1NDcsImlzcyI6Imh0dHBzOi8vaHVnZ2luZ2ZhY2UuY28ifQ.g7Xuwvwqlk8DUSLYj7U86YuNQ2E3VFpP4eKrt7cFAoixzJsMT800bkDJVz1K7Wrrfyo54yq-FXG3x7YsblWWAw 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 [61]

INFO | 2025-01-04 20:55:46 | autotrain.app.app::24 - AutoTrain started successfully

INFO | 2025-01-04 20:55:46 | autotrain.app.app::23 - AutoTrain version: 0.8.34

INFO | 2025-01-04 20:55:46 | autotrain.app.app::13 - Starting AutoTrain…

INFO | 2025-01-04 20:55:45 | autotrain.app.ui\_routes::315 - AutoTrain started successfully

INFO | 2025-01-04 20:55:43 | autotrain.app.ui\_routes::31 - 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](https://discuss.huggingface.co/u/John6666)\
**Post date:** [January 6, 2025, 3:23am UTC](https://discuss.huggingface.co/t/complete-beginner-error-500-templateresponse-has-no-len-what-does-this-mean/134314/2 "2025-01-06T03:23:28Z")

</div>

The symptoms are similar to this issue…

> <https://github.com/huggingface/autotrain-advanced/issues/786>
>
> \### Prerequisites
> 
> \- \[X\] I have read the \[documentation\](https://hf.co/docs/auto…train).
> \- \[X\] I have checked other issues for similar problems.
> 
> \### Backend
> 
> Hugging Face Space/Endpoints
> 
> \### Interface Used
> 
> UI
> 
> \### CLI Command
> 
> \_No response\_
> 
> \### UI Screenshots & Parameters
> 
> Issue with AutoTrain Advanced:
> 
> Project: Fine-tuning LLM (Legacy-Ledger-Fine-Tune-v1)
> Base Model: meta-llama/Llama-3-1-8B-Instruct
> Dataset: mb7419/legal-advice-reddit (Hugging Face Hub)
> 
> Error Description:
> 
> Initial error: ValueError regarding unknown split "0.8"
> Subsequent error: subprocess.CalledProcessError when launching training
> 
> Key Error Details:
> 
> Command execution failed with non-zero exit status 2
> Unrecognized arguments: repeated "-m autotrain.trainers.clm"
> Training process (PID 354) terminated unexpectedly
> 
> Additional Notes:
> 
> Accelerate configuration warnings present
> Issue persists after addressing initial dataset split problem
> 
> The errors suggest a potential bug in the AutoTrain backend, possibly related to command argument handling or training process initialization. This prevents the training from starting successfully.
> \<img width="1196" alt="Screenshot 2024-10-04 at 1 14 44 PM" src="https://github.com/user-attachments/assets/922597d6-2eb9-40f1-a528-1caf669d51cb"\>
> 
> 
> \### Error Logs
> 
> INFO | 2024-10-04 20:09:15 | autotrain.app.utils:kill\_process\_by\_pid:52 - Sent SIGTERM to process with PID 354
> 
> INFO | 2024-10-04 20:09:15 | autotrain.app.utils:get\_running\_jobs:26 - Killing PID: 354
> 
> subprocess.CalledProcessError: Command '\['/app/env/bin/python', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json'\]' returned non-zero exit status 2.
> 
> raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
> 
> File "/app/env/lib/python3.10/site-packages/accelerate/commands/launch.py", line 769, in simple\_launcher
> 
> simple\_launcher(args)
> 
> File "/app/env/lib/python3.10/site-packages/accelerate/commands/launch.py", line 1174, in launch\_command
> 
> args.func(args)
> 
> File "/app/env/lib/python3.10/site-packages/accelerate/commands/accelerate\_cli.py", line 48, in main
> 
> sys.exit(main())
> 
> File "/app/env/bin/accelerate", line 8, in \<module\>
> 
> Traceback (most recent call last):
> 
> \_\_main\_\_.py: error: unrecognized arguments: -m autotrain.trainers.clm -m autotrain.trainers.clm
> 
> usage: \_\_main\_\_.py \[-h\] --training\_config TRAINING\_CONFIG
> 
> To avoid this warning pass in values for each of the problematic parameters or run \`accelerate config\`.
> 
> \`--dynamo\_backend\` was set to a value of \`'no'\`
> 
> \`--mixed\_precision\` was set to a value of \`'no'\`
> 
> \`--num\_machines\` was set to a value of \`1\`
> 
> \`--num\_processes\` was set to a value of \`0\`
> 
> The following values were not passed to \`accelerate launch\` and had defaults used instead:
> 
> INFO | 2024-10-04 20:09:10 | autotrain.backends.local:create:13 - Training PID: 354
> 
> INFO | 2024-10-04 20:09:10 | autotrain.commands:launch\_command:502 - {'model': 'meta-llama/Llama-3.2-3B-Instruct', 'project\_name': 'legacy-ledger-at-v1', 'data\_path': 'bunny0702/Legal\_Research', 'train\_split': '0.8', 'valid\_split': None, 'add\_eos\_token': True, 'block\_size': 1024, 'model\_max\_length': 2048, 'padding': 'right', 'trainer': 'sft', 'use\_flash\_attention\_2': False, 'log': 'tensorboard', 'disable\_gradient\_checkpointing': False, 'logging\_steps': -1, 'eval\_strategy': 'epoch', 'save\_total\_limit': 1, 'auto\_find\_batch\_size': False, 'mixed\_precision': 'bf16', 'lr': 3e-05, 'epochs': 3, 'batch\_size': 8, 'warmup\_ratio': 0.1, 'gradient\_accumulation': 4, 'optimizer': 'adamw\_torch', 'scheduler': 'linear', 'weight\_decay': 0.0, 'max\_grad\_norm': 1.0, 'seed': 42, 'chat\_template': 'none', 'quantization': 'int4', 'target\_modules': 'all-linear', 'merge\_adapter': False, 'peft': True, 'lora\_r': 16, 'lora\_alpha': 32, 'lora\_dropout': 0.05, 'model\_ref': None, 'dpo\_beta': 0.1, 'max\_prompt\_length': 128, 'max\_completion\_length': None, 'prompt\_text\_column': 'prompt', 'text\_column': 'text', 'rejected\_text\_column': 'rejected\_text', 'push\_to\_hub': True, 'username': 'Gladystoper', 'token': '\*\*\*\*\*', 'unsloth': False, 'distributed\_backend': None}
> 
> INFO | 2024-10-04 20:09:10 | autotrain.commands:launch\_command:501 - \['accelerate', 'launch', '--cpu', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json'\]
> 
> WARNING | 2024-10-04 20:09:10 | autotrain.commands:get\_accelerate\_command:52 - No GPU found. Forcing training on CPU. This will be super slow!
> 
> INFO | 2024-10-04 20:09:10 | autotrain.backends.local:create:8 - Starting local training...
> 
> INFO | 2024-10-04 20:09:10 | autotrain.app.ui\_routes:handle\_form:500 - hardware: local-ui
> 
> INFO | 2024-10-04 20:08:05 | autotrain.app.utils:kill\_process\_by\_pid:52 - Sent SIGTERM to process with PID 352
> 
> INFO | 2024-10-04 20:08:05 | autotrain.app.utils:get\_running\_jobs:26 - Killing PID: 352
> 
> subprocess.CalledProcessError: Command '\['/app/env/bin/python', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json'\]' returned non-zero exit status 2.
> 
> raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
> 
> File "/app/env/lib/python3.10/site-packages/accelerate/commands/launch.py", line 769, in simple\_launcher
> 
> simple\_launcher(args)
> 
> File "/app/env/lib/python3.10/site-packages/accelerate/commands/launch.py", line 1174, in launch\_command
> 
> args.func(args)
> 
> File "/app/env/lib/python3.10/site-packages/accelerate/commands/accelerate\_cli.py", line 48, in main
> 
> sys.exit(main())
> 
> File "/app/env/bin/accelerate", line 8, in \<module\>
> 
> Traceback (most recent call last):
> 
> \_\_main\_\_.py: error: unrecognized arguments: -m autotrain.trainers.clm
> 
> usage: \_\_main\_\_.py \[-h\] --training\_config TRAINING\_CONFIG
> 
> To avoid this warning pass in values for each of the problematic parameters or run \`accelerate config\`.
> 
> \`--dynamo\_backend\` was set to a value of \`'no'\`
> 
> \`--mixed\_precision\` was set to a value of \`'no'\`
> 
> \`--num\_machines\` was set to a value of \`1\`
> 
> \`--num\_processes\` was set to a value of \`0\`
> 
> The following values were not passed to \`accelerate launch\` and had defaults used instead:
> 
> INFO | 2024-10-04 20:07:59 | autotrain.backends.local:create:13 - Training PID: 352
> 
> INFO | 2024-10-04 20:07:59 | autotrain.commands:launch\_command:502 - {'model': 'meta-llama/Llama-3.2-3B-Instruct', 'project\_name': 'legacy-ledger-at-v1', 'data\_path': 'bunny0702/Legal\_Research', 'train\_split': '0.8', 'valid\_split': None, 'add\_eos\_token': True, 'block\_size': 1024, 'model\_max\_length': 2048, 'padding': 'right', 'trainer': 'sft', 'use\_flash\_attention\_2': False, 'log': 'tensorboard', 'disable\_gradient\_checkpointing': False, 'logging\_steps': -1, 'eval\_strategy': 'epoch', 'save\_total\_limit': 1, 'auto\_find\_batch\_size': False, 'mixed\_precision': 'fp16', 'lr': 3e-05, 'epochs': 3, 'batch\_size': 2, 'warmup\_ratio': 0.1, 'gradient\_accumulation': 4, 'optimizer': 'adamw\_torch', 'scheduler': 'linear', 'weight\_decay': 0.0, 'max\_grad\_norm': 1.0, 'seed': 42, 'chat\_template': 'none', 'quantization': 'int4', 'target\_modules': 'all-linear', 'merge\_adapter': False, 'peft': True, 'lora\_r': 16, 'lora\_alpha': 32, 'lora\_dropout': 0.05, 'model\_ref': None, 'dpo\_beta': 0.1, 'max\_prompt\_length': 128, 'max\_completion\_length': None, 'prompt\_text\_column': 'prompt', 'text\_column': 'text', 'rejected\_text\_column': 'rejected\_text', 'push\_to\_hub': True, 'username': 'Gladystoper', 'token': '\*\*\*\*\*', 'unsloth': False, 'distributed\_backend': None}
> 
> INFO | 2024-10-04 20:07:59 | autotrain.commands:launch\_command:501 - \['accelerate', 'launch', '--cpu', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json'\]
> 
> WARNING | 2024-10-04 20:07:59 | autotrain.commands:get\_accelerate\_command:52 - No GPU found. Forcing training on CPU. This will be super slow!
> 
> INFO | 2024-10-04 20:07:59 | autotrain.backends.local:create:8 - Starting local training...
> 
> INFO | 2024-10-04 20:07:59 | autotrain.app.ui\_routes:handle\_form:500 - hardware: local-ui
> 
> INFO | 2024-10-04 20:07:29 | autotrain.app.ui\_routes:handle\_form:500 - hardware: local-ui
> 
> INFO | 2024-10-04 20:06:30 | autotrain.app.utils:kill\_process\_by\_pid:52 - Sent SIGTERM to process with PID 343
> 
> INFO | 2024-10-04 20:06:30 | autotrain.app.utils:get\_running\_jobs:26 - Killing PID: 343
> 
> ERROR | 2024-10-04 20:06:26 | autotrain.trainers.common:wrapper:121 - Unknown split "0.8". Should be one of \['train'\].
> 
> ValueError: Unknown split "0.8". Should be one of \['train'\].
> 
> raise ValueError(f'Unknown split "{split}". Should be one of {list(name2len)}.')
> 
> File "/app/env/lib/python3.10/site-packages/datasets/arrow\_reader.py", line 480, in \_rel\_to\_abs\_instr
> 
> return \[\_rel\_to\_abs\_instr(rel\_instr, name2len) for rel\_instr in self.\_relative\_instructions\]
> 
> File "/app/env/lib/python3.10/site-packages/datasets/arrow\_reader.py", line 663, in \<listcomp\>
> 
> return \[\_rel\_to\_abs\_instr(rel\_instr, name2len) for rel\_instr in self.\_relative\_instructions\]
> 
> File "/app/env/lib/python3.10/site-packages/datasets/arrow\_reader.py", line 663, in to\_absolute
> 
> absolute\_instructions = instruction.to\_absolute(name2len)
> 
> File "/app/env/lib/python3.10/site-packages/datasets/arrow\_reader.py", line 134, in make\_file\_instructions
> 
> file\_instructions = make\_file\_instructions(
> 
> File "/app/env/lib/python3.10/site-packages/datasets/arrow\_reader.py", line 225, in get\_file\_instructions
> 
> files = self.get\_file\_instructions(name, instructions, split\_infos)
> 
> File "/app/env/lib/python3.10/site-packages/datasets/arrow\_reader.py", line 252, in read
> 
> dataset\_kwargs = ArrowReader(cache\_dir, self.info).read(
> 
> File "/app/env/lib/python3.10/site-packages/datasets/builder.py", line 1370, in \_as\_dataset
> 
> ds = self.\_as\_dataset(
> 
> File "/app/env/lib/python3.10/site-packages/datasets/builder.py", line 1296, in \_build\_single\_dataset
> 
> mapped = function(data\_struct)
> 
> File "/app/env/lib/python3.10/site-packages/datasets/utils/py\_utils.py", line 484, in map\_nested
> 
> datasets = map\_nested(
> 
> File "/app/env/lib/python3.10/site-packages/datasets/builder.py", line 1266, in as\_dataset
> 
> ds = builder\_instance.as\_dataset(split=split, verification\_mode=verification\_mode, in\_memory=keep\_in\_memory)
> 
> File "/app/env/lib/python3.10/site-packages/datasets/load.py", line 2621, in load\_dataset
> 
> train\_data = load\_dataset(
> 
> File "/app/env/lib/python3.10/site-packages/autotrain/trainers/clm/utils.py", line 351, in process\_input\_data
> 
> train\_data, valid\_data = utils.process\_input\_data(config)
> 
> File "/app/env/lib/python3.10/site-packages/autotrain/trainers/clm/train\_clm\_sft.py", line 14, in train
> 
> train\_sft(config)
> 
> File "/app/env/lib/python3.10/site-packages/autotrain/trainers/clm/\_\_main\_\_.py", line 28, in train
> 
> return func(\*args, \*\*kwargs)
> 
> File "/app/env/lib/python3.10/site-packages/autotrain/trainers/common.py", line 117, in wrapper
> 
> ERROR | 2024-10-04 20:06:26 | autotrain.trainers.common:wrapper:120 - train has failed due to an exception: Traceback (most recent call last):
> 
> Generating train split: 100%|██████████| 155703/155703 \[00:00\<00:00, 3644055.24 examples/s\]
> 
> Generating train split: 0%| | 0/155703 \[00:00\<?, ? examples/s\]
> 
> Downloading data: 100%|██████████| 180k/180k \[00:00\<00:00, 1.35MB/s\]
> 
> Downloading data: 100%|██████████| 180k/180k \[00:00\<00:00, 1.36MB/s\]
> 
> Downloading data: 100%|██████████| 2.83M/2.83M \[00:00\<00:00, 8.18MB/s\]
> 
> Downloading data: 100%|██████████| 2.83M/2.83M \[00:00\<00:00, 8.23MB/s\]
> 
> Downloading data: 100%|██████████| 5.84k/5.84k \[00:00\<00:00, 50.1kB/s\]
> 
> Downloading data: 100%|██████████| 5.84k/5.84k \[00:00\<00:00, 50.2kB/s\]
> 
> Downloading data: 0%| | 0.00/5.84k \[00:00\<?, ?B/s\]
> 
> Downloading data: 100%|██████████| 152k/152k \[00:00\<00:00, 764kB/s\]
> 
> Downloading data: 100%|██████████| 152k/152k \[00:00\<00:00, 767kB/s\]
> 
> Downloading data: 0%| | 0.00/152k \[00:00\<?, ?B/s\]
> 
> INFO | 2024-10-04 20:06:22 | autotrain.trainers.clm.train\_clm\_sft:train:11 - Starting SFT training...
> 
> To avoid this warning pass in values for each of the problematic parameters or run \`accelerate config\`.
> 
> \`--dynamo\_backend\` was set to a value of \`'no'\`
> 
> \`--mixed\_precision\` was set to a value of \`'no'\`
> 
> \`--num\_machines\` was set to a value of \`1\`
> 
> \`--num\_processes\` was set to a value of \`0\`
> 
> The following values were not passed to \`accelerate launch\` and had defaults used instead:
> 
> INFO | 2024-10-04 20:06:17 | autotrain.backends.local:create:13 - Training PID: 343
> 
> INFO | 2024-10-04 20:06:17 | autotrain.commands:launch\_command:502 - {'model': 'meta-llama/Llama-3.2-3B-Instruct', 'project\_name': 'legacy-ledger-at-v1', 'data\_path': 'bunny0702/Legal\_Research', 'train\_split': '0.8', 'valid\_split': None, 'add\_eos\_token': True, 'block\_size': 1024, 'model\_max\_length': 2048, 'padding': 'right', 'trainer': 'sft', 'use\_flash\_attention\_2': False, 'log': 'tensorboard', 'disable\_gradient\_checkpointing': False, 'logging\_steps': -1, 'eval\_strategy': 'epoch', 'save\_total\_limit': 1, 'auto\_find\_batch\_size': False, 'mixed\_precision': 'fp16', 'lr': 3e-05, 'epochs': 3, 'batch\_size': 2, 'warmup\_ratio': 0.1, 'gradient\_accumulation': 4, 'optimizer': 'adamw\_torch', 'scheduler': 'linear', 'weight\_decay': 0.0, 'max\_grad\_norm': 1.0, 'seed': 42, 'chat\_template': 'none', 'quantization': 'int4', 'target\_modules': 'all-linear', 'merge\_adapter': False, 'peft': True, 'lora\_r': 16, 'lora\_alpha': 32, 'lora\_dropout': 0.05, 'model\_ref': None, 'dpo\_beta': 0.1, 'max\_prompt\_length': 128, 'max\_completion\_length': None, 'prompt\_text\_column': 'prompt', 'text\_column': 'text', 'rejected\_text\_column': 'rejected\_text', 'push\_to\_hub': True, 'username': 'Gladystoper', 'token': '\*\*\*\*\*', 'unsloth': False, 'distributed\_backend': None}
> 
> INFO | 2024-10-04 20:06:17 | autotrain.commands:launch\_command:501 - \['accelerate', 'launch', '--cpu', '-m', 'autotrain.trainers.clm', '--training\_config', 'legacy-ledger-at-v1/training\_params.json'\]
> 
> WARNING | 2024-10-04 20:06:17 | autotrain.commands:get\_accelerate\_command:52 - No GPU found. Forcing training on CPU. This will be super slow!
> 
> INFO | 2024-10-04 20:06:17 | autotrain.backends.local:create:8 - Starting local training...
> 
> INFO | 2024-10-04 20:06:17 | autotrain.app.ui\_routes:handle\_form:500 - hardware: local-ui
> 
> INFO | 2024-10-04 20:05:25 | autotrain.app.ui\_routes:fetch\_params:391 - Param distributed\_backend not found in UI\_PARAMS
> 
> INFO | 2024-10-04 20:05:25 | autotrain.app.ui\_routes:fetch\_params:381 - Task: llm:sft
> 
> INFO: 10.203.0.7:58006 - "GET /?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2NTEwNTY4YThmMzIyOGQ4MDdhNzFkNjkiLCJ1c2VyIjoiR2xhZHlzdG9wZXIifSwiaWF0IjoxNzI4MDcyMzIzLCJzdWIiOiIvc3BhY2VzL0dsYWR5c3RvcGVyL2F1dG90cmFpbi1hZHZhbmNlZCIsImV4cCI6MTcyODE1ODcyMywiaXNzIjoiaHR0cHM6Ly9odWdnaW5nZmFjZS5jbyJ9.f01ZyphHQ-H1f0hqNduC6oLd-R1\_oqQqrJOE4IGNDVV1ESg\_RZRun38N4lLoWEPOn91dfw6jvrJg\_Ilg42nlAA HTTP/1.1" 307 Temporary Redirect
> 
> INFO: 10.203.4.41:54838 - "GET /?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2NTEwNTY4YThmMzIyOGQ4MDdhNzFkNjkiLCJ1c2VyIjoiR2xhZHlzdG9wZXIifSwiaWF0IjoxNzI4MDcyMzIzLCJzdWIiOiIvc3BhY2VzL0dsYWR5c3RvcGVyL2F1dG90cmFpbi1hZHZhbmNlZCIsImV4cCI6MTcyODE1ODcyMywiaXNzIjoiaHR0cHM6Ly9odWdnaW5nZmFjZS5jbyJ9.f01ZyphHQ-H1f0hqNduC6oLd-R1\_oqQqrJOE4IGNDVV1ESg\_RZRun38N4lLoWEPOn91dfw6jvrJg\_Ilg42nlAA HTTP/1.1" 307 Temporary Redirect
> 
> INFO | 2024-10-04 20:02:27 | autotrain.app.ui\_routes:fetch\_params:391 - Param distributed\_backend not found in UI\_PARAMS
> 
> INFO | 2024-10-04 20:02:27 | autotrain.app.ui\_routes:fetch\_params:381 - Task: llm:sft
> 
> INFO: 10.203.0.7:39860 - "GET /?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2NTEwNTY4YThmMzIyOGQ4MDdhNzFkNjkiLCJ1c2VyIjoiR2xhZHlzdG9wZXIifSwiaWF0IjoxNzI4MDcyMTQ2LCJzdWIiOiIvc3BhY2VzL0dsYWR5c3RvcGVyL2F1dG90cmFpbi1hZHZhbmNlZCIsImV4cCI6MTcyODE1ODU0NiwiaXNzIjoiaHR0cHM6Ly9odWdnaW5nZmFjZS5jbyJ9.mmzj3\_JYvkG4SsyTvlNl9oxBl8jfpuK0wlbQMjZeBfjEK28ijS6sSYk6hPH9PS3oKIfdqJSof2omk9KDpPrCDg HTTP/1.1" 307 Temporary Redirect
> 
> INFO: 10.203.4.41:52548 - "GET /?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2NTEwNTY4YThmMzIyOGQ4MDdhNzFkNjkiLCJ1c2VyIjoiR2xhZHlzdG9wZXIifSwiaWF0IjoxNzI4MDcyMTQ2LCJzdWIiOiIvc3BhY2VzL0dsYWR5c3RvcGVyL2F1dG90cmFpbi1hZHZhbmNlZCIsImV4cCI6MTcyODE1ODU0NiwiaXNzIjoiaHR0cHM6Ly9odWdnaW5nZmFjZS5jbyJ9.mmzj3\_JYvkG4SsyTvlNl9oxBl8jfpuK0wlbQMjZeBfjEK28ijS6sSYk6hPH9PS3oKIfdqJSof2omk9KDpPrCDg HTTP/1.1" 307 Temporary Redirect
> 
> INFO | 2024-10-04 20:01:49 | autotrain.app.ui\_routes:fetch\_params:391 - Param distributed\_backend not found in UI\_PARAMS
> 
> INFO | 2024-10-04 20:01:49 | autotrain.app.ui\_routes:fetch\_params:381 - Task: llm:sft
> 
> INFO: 10.203.0.7:53992 - "GET / HTTP/1.1" 307 Temporary Redirect
> 
> INFO: 10.203.0.7:53992 - "GET /auth?code=pCIvjXNYbHDvcDZN&state=rLaqKVN6FpwF0ETcx5Ga0HWfrCqb1t HTTP/1.1" 307 Temporary Redirect
> 
> INFO: 10.203.0.7:53992 - "GET /login/huggingface?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2NTEwNTY4YThmMzIyOGQ4MDdhNzFkNjkiLCJ1c2VyIjoiR2xhZHlzdG9wZXIifSwiaWF0IjoxNzI4MDcyMTA0LCJzdWIiOiIvc3BhY2VzL0dsYWR5c3RvcGVyL2F1dG90cmFpbi1hZHZhbmNlZCIsImV4cCI6MTcyODE1ODUwNCwiaXNzIjoiaHR0cHM6Ly9odWdnaW5nZmFjZS5jbyJ9.DDPA7r37oUjUrnhV4tKSThbbemp4bIlcRJ1jITIKI4kUp9EnwopGjjP1bqvWjVOQ7DpzZaI94JfFeCIcK-mVBQ HTTP/1.1" 302 Found
> 
> ERROR | 2024-10-04 20:01:45 | autotrain.app.ui\_routes:load\_index:347 - Failed to get user and orgs: object of type '\_TemplateResponse' has no len()
> 
> INFO: 10.203.0.7:53992 - "GET /?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2NTEwNTY4YThmMzIyOGQ4MDdhNzFkNjkiLCJ1c2VyIjoiR2xhZHlzdG9wZXIifSwiaWF0IjoxNzI4MDcyMTA0LCJzdWIiOiIvc3BhY2VzL0dsYWR5c3RvcGVyL2F1dG90cmFpbi1hZHZhbmNlZCIsImV4cCI6MTcyODE1ODUwNCwiaXNzIjoiaHR0cHM6Ly9odWdnaW5nZmFjZS5jbyJ9.DDPA7r37oUjUrnhV4tKSThbbemp4bIlcRJ1jITIKI4kUp9EnwopGjjP1bqvWjVOQ7DpzZaI94JfFeCIcK-mVBQ HTTP/1.1" 307 Temporary Redirect
> 
> INFO: 10.203.4.41:36212 - "GET /?\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2NTEwNTY4YThmMzIyOGQ4MDdhNzFkNjkiLCJ1c2VyIjoiR2xhZHlzdG9wZXIifSwiaWF0IjoxNzI4MDcyMTA0LCJzdWIiOiIvc3BhY2VzL0dsYWR5c3RvcGVyL2F1dG90cmFpbi1hZHZhbmNlZCIsImV4cCI6MTcyODE1ODUwNCwiaXNzIjoiaHR0cHM6Ly9odWdnaW5nZmFjZS5jbyJ9.DDPA7r37oUjUrnhV4tKSThbbemp4bIlcRJ1jITIKI4kUp9EnwopGjjP1bqvWjVOQ7DpzZaI94JfFeCIcK-mVBQ HTTP/1.1" 307 Temporary Redirect
> 
> ERROR | 2024-10-04 02:03:05 | autotrain.app.ui\_routes:user\_authentication:324 - Failed to verify token: Invalid token (/oauth/userinfo). Please login with a write token.
> 
> ERROR | 2024-10-04 02:03:05 | autotrain.app.utils:token\_verification:84 - Failed to request /oauth/userinfo - 504
> 
> ERROR | 2024-10-04 02:03:05 | autotrain.app.ui\_routes:user\_authentication:324 - Failed to verify token: Invalid token (/oauth/userinfo). Please login with a write token.
> 
> ERROR | 2024-10-04 02:03:05 | autotrain.app.utils:token\_verification:84 - Failed to request /oauth/userinfo - 504
> 
> INFO | 2024-10-04 01:42:36 | autotrain.app.ui\_routes:fetch\_params:391 - Param distributed\_backend not found in UI\_PARAMS
> 
> INFO | 2024-10-04 01:42:36 | autotrain.app.ui\_routes:fetch\_params:381 - Task: llm:sft
> 
> INFO: 10.203.14.122:50602 - "GET /?logs=build&\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2NTEwNTY4YThmMzIyOGQ4MDdhNzFkNjkiLCJ1c2VyIjoiR2xhZHlzdG9wZXIifSwiaWF0IjoxNzI4MDA2MTUzLCJzdWIiOiIvc3BhY2VzL0dsYWR5c3RvcGVyL2F1dG90cmFpbi1hZHZhbmNlZCIsImV4cCI6MTcyODA5MjU1MywiaXNzIjoiaHR0cHM6Ly9odWdnaW5nZmFjZS5jbyJ9.dnUKIVelGNJw5CMS1JkW3wgFATQbdXScm-1aELkG\_U5msHucvhHlC4R7445LYEB\_HWfk1M0LXep7fk1A8mWhDg HTTP/1.1" 307 Temporary Redirect
> 
> INFO: 10.203.14.157:50772 - "GET /?logs=build&\_\_sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2NTEwNTY4YThmMzIyOGQ4MDdhNzFkNjkiLCJ1c2VyIjoiR2xhZHlzdG9wZXIifSwiaWF0IjoxNzI4MDA2MTUzLCJzdWIiOiIvc3BhY2VzL0dsYWR5c3RvcGVyL2F1dG90cmFpbi1hZHZhbmNlZCIsImV4cCI6MTcyODA5MjU1MywiaXNzIjoiaHR0cHM6Ly9odWdnaW5nZmFjZS5jbyJ9.dnUKIVelGNJw5CMS1JkW3wgFATQbdXScm-1aELkG\_U5msHucvhHlC4R7445LYEB\_HWfk1M0LXep7fk1A8mWhDg HTTP/1.1" 307 Temporary Redirect
> 
> INFO: Uvicorn running on http://0.0.0.0:7860 (Press CTRL+C to quit)
> 
> INFO: Application startup complete.
> 
> INFO: Waiting for application startup.
> 
> INFO: Started server process \[121\]
> 
> INFO | 2024-10-04 01:42:32 | autotrain.app.app:\<module\>:24 - AutoTrain started successfully
> 
> INFO | 2024-10-04 01:42:32 | autotrain.app.app:\<module\>:23 - AutoTrain version: 0.8.21
> 
> INFO | 2024-10-04 01:42:32 | autotrain.app.app:\<module\>:13 - Starting AutoTrain...
> 
> INFO | 2024-10-04 01:42:32 | autotrain.app.ui\_routes:\<module\>:298 - AutoTrain started successfully
> 
> INFO | 2024-10-04 01:42:27 | autotrain.app.ui\_routes:\<module\>:32 - Starting AutoTrain...
> 
> \### Additional Information
> 
> \_No response\_

> <https://github.com/huggingface/autotrain-advanced/issues/255>
>
> tried to train a model with a 40,000 line long .csv and would instantly give me …this error upon trying to start without specifying block size, changed block size to 16 and got further but still crashed eventually. 
> !\[image\](https://github.com/huggingface/autotrain-advanced/assets/66864565/29621374-5ce7-4513-a405-829ec3b066bb)

---

<div class="post-metadata">

**Author:** ![ValdeJunior](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valdejunior/32/38351_2.png) [@ValdeJunior](https://discuss.huggingface.co/u/ValdeJunior)\
**Post date:** [January 6, 2025, 7:13am UTC](https://discuss.huggingface.co/t/complete-beginner-error-500-templateresponse-has-no-len-what-does-this-mean/134314/3 "2025-01-06T07:13:34Z")

</div>

1. Check Column Names in CSV
2. Verify the CSV Structure
3. Column Mapping Configuration
4. Validate Data import process
5. Review Any Tempplate/Request Errors
6. File permissions or File size
