Skip to content

Commit 3d3e9c9

Browse files
authored
Fix: Issue of failure to initialize input_converter in Seq2SeqGenerator when model_file_path is given as folder path on local disk after manual model download (#4213)
* test * test documentation commit: * added original return statement for linting * removed empty lines * formatted code using black * made changes based on suggestions
1 parent 2c9e4c5 commit 3d3e9c9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

haystack/nodes/answer_generator/transformers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ def _register_converters(cls, model_name_or_path: str, custom_converter: Optiona
413413

414414
@classmethod
415415
def _get_converter(cls, model_name_or_path: str) -> Optional[Callable]:
416+
# using dictionary key based on model_name_or_path endswith
417+
if model_name_or_path.endswith("bart_lfqa"):
418+
model_name_or_path = "vblagoje/bart_lfqa"
419+
elif model_name_or_path.endswith("bart_eli5"):
420+
model_name_or_path = "yjernite/bart_eli5"
416421
return cls._model_input_converters.get(model_name_or_path)
417422

418423
def predict(self, query: str, documents: List[Document], top_k: Optional[int] = None) -> Dict:

0 commit comments

Comments
 (0)