If it was a sweet potato he’ll be fine. But true yams must be cooked to not be poisonous, much like cassava. Some animals eat cassava raw though and are fine with it. I think true sweet potatoes are called yams in some parts of the USA though. So it was probably sweet potato he ate, and that’s ok, only too sweet to be fed often.
Sorry if I’m being unclear, but I find it so difficult to distinguish between all the various yams and sweet potatoes, esp the purple varieties. Do you know if the sweet potato/jam you have can be consumed raw by humans, for example in the form of shavings in a salad? If they are that type, they’re harmless to your bun.
After 2 hours I think he would have started to show symptoms if he ate sth poisonous. How does he seem? Activity-wise, I mean.
You can use his normal pellets for training if you like, reserve a small portion of the pellets for training instead of serving it all to him. For training you want treats that he can eat quickly, or there will be long pauses while he munches.