error when submitting machine learning project
The return type of pandas.DataFrame.to_csv is None.

So your first line assigns sub = None: 

sub = pd.DataFrame({'instructions': test['instructions'],'compiler':new_pred_class}).to_csv('sub.csv')


This is probably what you wanted:

sub = pd.DataFrame({'instructions': test['instructions'],'compiler':new_pred_class})
sub.to_csv('sub.csv')
sub.head()