I am trying to fine-tune “google/tapas-base” on ‘google/tapas-base-finetuned-wtq’ config. I get the following error.
File "C:\Users\Kinjal\.conda\envs\nlp\lib\site- packages\transformers\models\tapas\tokenization_tapas.py", line 1668, in <listcomp>
return [(coords[1], coords[0]) for coords in answer_coordinates_question]
IndexError: string index out of range
I think the error is because of the coordinates given in the “answer_coordinates” of the TSV sheet. I tried using (row,col) and (col,row) but in both the cases I get the same error. Also, the answer coordinates are within the range of the table i.e. (0 to nrow-1, 0 to ncol-1)
Is there something I am missing here? Or is the error because of something else.
could it be that you’re providing the answer coordinates in the wrong way? You are probably providing the coordinates as a string, but they should be provided as Python tuples.
Thanks for the reply. I am providing the coordinates as tuples for every answer [(0,1)] like so. But i guess when it does the swapping of rows to columns in the function:
def _to_coordinates(answer_coordinates_question):
return [(coords[1], coords[0]) for coords in answer_coordinates_question]
The [(0,1)] gets passed as a string such as ‘[(0,1)]’ and that’s where the error comes. I don’t know how to remove the ’ ’ from there.