# Finetuning a model using Autotrain error :(

**URL:** <https://discuss.huggingface.co/t/finetuning-a-model-using-autotrain-error/78871>\
**Category:** 🤗AutoTrain\
**Created:** [March 27, 2024, 4:49am UTC](https://discuss.huggingface.co/t/finetuning-a-model-using-autotrain-error/78871 "2024-03-27T04:49:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hadiboo](https://avatars.discourse-cdn.com/v4/letter/h/67e7ee/32.png) [@Hadiboo](https://discuss.huggingface.co/u/Hadiboo)\
**Post date:** [March 27, 2024, 4:49am UTC](https://discuss.huggingface.co/t/finetuning-a-model-using-autotrain-error/78871/1 "2024-03-27T04:49:12Z")

</div>

Hey guys! I’m getting this error message on logs while finetuning my model "❌ ERROR | 2024-03-27 04:31:20 | autotrain.trainers.common:wrapper:93 - train has failed due to an exception: Traceback (most recent call last):  
File “/app/env/lib/python3.10/site-packages/autotrain/trainers/common.py”, line 90, in wrapper  
return func(\*args, \*\*kwargs)  
File “/app/env/lib/python3.10/site-packages/autotrain/trainers/clm/ **main**.py”, line 281, in train  
if model\_ref is not None:  
UnboundLocalError: local variable ‘model\_ref’ referenced before assignment

❌ ERROR | 2024-03-27 04:31:20 | autotrain.trainers.common:wrapper:94 - local variable ‘model\_ref’ referenced before assignment  
🚀 INFO | 2024-03-27 04:31:20 | autotrain.trainers.common:pause\_space:51 - Pausing space…"

Information:  
1-here is a snippet of my csv file:  
text,target,rejected\_text  
You always seem so serious. Smile more!,“Hmph, as if my face is any of your business.”,  
2-I’m using the free version (on CPU)  
3- the picture uploaded shows more details about my very basic parameters and the task (the is LLM reward, model is gpt2, also tried mistral 7b)

 ![screenshot](https://us1.discourse-cdn.com/hellohellohello/original/3X/3/4/34b357e36155d6f1f162d0e229dd0b1694255d56.png)
