• Lalit Pagaria's avatar
    [RAG] Propagating of n_docs as parameter to all RagModel's related functions (#7891) · 0193c829
    Lalit Pagaria authored
    
    
    * Propagating n_docs as parameter to all RagModel's related functions that defaults to self.config.n_docs
    
    * Making n_docs parameter's default value to None in marginalize function
    
    * Fixing code quality issues
    
    * Handle the special case when generator is of T5PreTrainedModel instance type. T5PreTrainedModel do not have n_docs as parameter
    
    * T5PreTrainedModel do not have n_docs as parameter
    
    * Addressing review comment
    Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
    
    * Correcting comment by addressing review comment
    
    * Adding assert statement verifying that n_docs is correctly set. n_docs should be the same for both retriever and generator.
    
    * Fixing flake8 reported issue
    
    * Correcting test datasets for rag
    
    * Using doc_scores instead of context_input_ids to check assert as in RagSequenceForGeneration context_input_ids can be null
    
    * doc_scores second dimension have number of retrieved docs
    
    * Changing assert comment
    
    * Apply suggestions from code review
    Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
    0193c829
test_modeling_rag.py 38.5 KB