Closed maifeeulasad closed 1 year ago
Hello!
SetFit actually uses datasets
Dataset
instances, rather than the purely torch Dataset
. There is some documentation on the huggingface datasets here, but there does not seem to be a very convenient way to convert a torch Dataset to a huggingface datasets Dataset. (Although it does seem possible in a hacky way).
Hope that helps.
@tomaarsen Thanks for this. I'm closing it now. But if I have any questions, I will send them your way.
Thanks a lot 🍸
I'm trying to experiment with PyTorch some model; the dataset they were using for the experiment is
sst
But I'm also learning PyTorch, so I thought it would be better to play with
Dataset
class and create my own dataset.So this was my approach:
Instead of creating sub-categories like validation/test/train, I'm just trying to create one custom
Dataset
class at first.And it keeps giving me
Cannot index by location index with a non-integer key
During conceptual development, I tried this:df.iloc[0].to_numpy()
, and it works absolutely fine. But it's sendingindex: text
for some reason. I even tried putting an 'id' column.But I'm sure that there must be some other way to achieve this. How can I resolve this issue? As my code worked fine for sst, as this not working any longer. I'm pretty sure, this is not one to one mapping.
Complete code: