Not sure why my model overfits

At the moment I am learning fastai2. The model I created works on tabular data. I followed Zachary Mueller’s tutorial on working with tabular data with fastai2. Created Tabular model and all. I placed it in KFold and used SMOTE in it before training the model. After I create lists for y_pred (with predictions for y target values) and y_test (with actual y values). I provide these values to classification_report and confusion matrix. Both of them show that the model’s accuracy is 1. So it’s overfitting or more accurately the model saw the test rows. I would like to understand what I did wrong.
the code:
for train_index, test_index in kf.split(X):
X_train, X_test = X.iloc[train_index], X.iloc[test_index]
y_train, y_test = y.iloc[train_index], y.iloc[test_index]

sm = SMOTE()
X_train_oversampled, y_train_oversampled = sm.fit_sample(X_train, y_train)

X_train = pd.DataFrame(X_train_oversampled, columns=columns, index=np.array(range(len(X_train_oversampled))))
X_train[y_names] = pd.Series(y_train_oversampled)
generated_part_len = len(X_train[len(train_index)+1:])
generated_part = X_train[len(train_index)+1:]
df_copy_generated = df.copy().append(generated_part, ignore_index=True)

train_index = L(list(train_index)) + L(list(range(len(df)+1, len(df)+1+generated_part_len-1)))
test_index = L(list(test_index))

splits = [train_index, test_index]

to = TabularPandas(df_copy_generated, procs=procs, cont_names=cont_names, y_names=y_names, y_block=y_block, splits=splits)
dls = to.dataloaders(bs=4096)
emb_sz = get_emb_sz(to)
cont_len = len(to.cont_names)

batch = dls.one_batch()
net = TabularModel(emb_sz, cont_len, 2, [200, 100])
learn = tabular_learner(dls, leyers=[200, 100], metrics=accuracy)
learn.fit(3, 1e-3)
c = Categorize(df_copy_generated[‘psl_kodas’].tolist())
dl = learn.dls.test_dl(df)
_,y_pred = learn.get_preds(dl=dl)
y_pred = y_pred.numpy().tolist()
y_pred = [item[0] for item in y_pred]
y_pred = [y_pred[i] for i in test_index]
y_test = [c(df_copy_generated.iloc[i][‘psl_kodas’]).numpy().tolist() for i in test_index]

print(classification_report(y_test, y_pred))
print(confusion_matrix(y_test, y_pred))

Thank you (I hope the code is formatted well in the post)