mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-11-03 03:09:28 +00:00
Make ctx_segment_ids a list instead of np.zeros_like
* fix #1687 * fix - UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow.. * fix RuntimeError: received 0 items of ancdata * Remove set_sharing_strategy from this branch and replace numpy.zeros_like with python numpy
This commit is contained in:
parent
39573cf0a9
commit
a1fb70bbbd
@ -1102,8 +1102,7 @@ class TextSimilarityProcessor(Processor):
|
||||
return_token_type_ids=True
|
||||
)
|
||||
|
||||
# TODO check if we need this and potentially remove
|
||||
ctx_segment_ids = np.zeros_like(ctx_inputs["token_type_ids"], dtype=np.int32)
|
||||
ctx_segment_ids = [[0] * len(ctx_inputs["token_type_ids"][0])] * len(ctx_inputs["token_type_ids"])
|
||||
|
||||
# get tokens in string format
|
||||
tokenized_passage = [self.passage_tokenizer.convert_ids_to_tokens(ctx) for ctx in ctx_inputs["input_ids"]]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user