Spaces:
GIZ
/
Running on CPU Upgrade

prashant commited on
Commit
4a866e0
1 Parent(s): 3c905d2

error fix for topk

Browse files
Files changed (1) hide show
  1. utils/semantic_search.py +3 -2
utils/semantic_search.py CHANGED
@@ -538,7 +538,7 @@ def semantic_keywordsearch(query:Text,documents:List[Document],
538
  embedding_layer:int, reader_model:str,
539
  retriever_top_k:int = 10, reader_top_k:int = 10,
540
  return_results:bool = False, embedding_dim:int = 768,
541
- max_seq_len:int = 512,
542
  sort_by:Literal["retriever", "reader"] = 'retriever'):
543
  """
544
  Performs the Semantic search on the List of haystack documents which is
@@ -556,7 +556,8 @@ def semantic_keywordsearch(query:Text,documents:List[Document],
556
  embedding_model_format= embedding_model_format,
557
  reader_model= reader_model, retriever_top_k= retriever_top_k,
558
  reader_top_k= reader_top_k, embedding_dim=embedding_dim,
559
- max_seq_len=max_seq_len)
 
560
 
561
  raw_output = runSemanticPipeline(semanticsearch_pipeline,query)
562
  results_df = process_semantic_output(raw_output)
 
538
  embedding_layer:int, reader_model:str,
539
  retriever_top_k:int = 10, reader_top_k:int = 10,
540
  return_results:bool = False, embedding_dim:int = 768,
541
+ max_seq_len:int = 512,top_k_per_candidate:int =1,
542
  sort_by:Literal["retriever", "reader"] = 'retriever'):
543
  """
544
  Performs the Semantic search on the List of haystack documents which is
 
556
  embedding_model_format= embedding_model_format,
557
  reader_model= reader_model, retriever_top_k= retriever_top_k,
558
  reader_top_k= reader_top_k, embedding_dim=embedding_dim,
559
+ max_seq_len=max_seq_len,
560
+ top_k_per_candidate=top_k_per_candidate)
561
 
562
  raw_output = runSemanticPipeline(semanticsearch_pipeline,query)
563
  results_df = process_semantic_output(raw_output)