Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -152,7 +152,7 @@ def prepare_training_data(qa_pairs, tokenizer):
|
|
152 |
context = "your_bhagavad_gita_text_here" # Replace with your preprocessed Bhagavad Gita text
|
153 |
context_encoded = tokenizer(context, add_special_tokens=True, return_tensors="pt")
|
154 |
# start_positions = answer_encoded.input_ids == tokenizer.convert_tokens_to_ids(tokenizer.sep_token)[0] # Find first SEP token
|
155 |
-
|
156 |
|
157 |
end_positions = answer_encoded.input_ids == [tokenizer.convert_tokens_to_ids(tokenizer.eos_token)[0]] # Find first EOS token
|
158 |
|
|
|
152 |
context = "your_bhagavad_gita_text_here" # Replace with your preprocessed Bhagavad Gita text
|
153 |
context_encoded = tokenizer(context, add_special_tokens=True, return_tensors="pt")
|
154 |
# start_positions = answer_encoded.input_ids == tokenizer.convert_tokens_to_ids(tokenizer.sep_token)[0] # Find first SEP token
|
155 |
+
start_positions = answer_encoded.input_ids == [tokenizer.convert_tokens_to_ids(tokenizer.sep_token)[0]]
|
156 |
|
157 |
end_positions = answer_encoded.input_ids == [tokenizer.convert_tokens_to_ids(tokenizer.eos_token)[0]] # Find first EOS token
|
158 |
|