Spaces:
GIZ
/
Running on CPU Upgrade

prashant commited on
Commit
dd2ab07
1 Parent(s): d7ce857

remove keybert

Browse files
Files changed (2) hide show
  1. requirements.txt +0 -1
  2. utils/semantic_search.py +6 -2
requirements.txt CHANGED
@@ -2,7 +2,6 @@ farm-haystack == 1.10
2
  farm-haystack[ocr]==1.10.0
3
  spacy==3.2.0
4
  https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0.tar.gz#egg=en_core_web_sm
5
- keybert==0.5.1
6
  matplotlib==3.5.1
7
  nltk==3.7
8
  numpy==1.22.1
 
2
  farm-haystack[ocr]==1.10.0
3
  spacy==3.2.0
4
  https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0.tar.gz#egg=en_core_web_sm
 
5
  matplotlib==3.5.1
6
  nltk==3.7
7
  numpy==1.22.1
utils/semantic_search.py CHANGED
@@ -254,7 +254,7 @@ def semanticSearchPipeline(documents:List[Document], embedding_model:Text = Non
254
  reader = FARMReader(model_name_or_path=reader_model,
255
  top_k = reader_top_k, use_gpu=True)
256
  semantic_search_pipeline = Pipeline()
257
- if useQueryCheck:
258
  querycheck = QueryCheck()
259
  semantic_search_pipeline.add_node(component = querycheck, name = "QueryCheck",
260
  inputs = ["Query"])
@@ -262,11 +262,15 @@ def semanticSearchPipeline(documents:List[Document], embedding_model:Text = Non
262
  inputs = ["QueryCheck.output_1"])
263
  semantic_search_pipeline.add_node(component = reader, name = "FARMReader",
264
  inputs= ["EmbeddingRetriever"])
265
- else:
266
  semantic_search_pipeline.add_node(component = retriever, name = "EmbeddingRetriever",
267
  inputs = ["Query"])
268
  semantic_search_pipeline.add_node(component = reader, name = "FARMReader",
269
  inputs= ["EmbeddingRetriever"])
 
 
 
 
270
 
271
  return semantic_search_pipeline, document_store
272
 
 
254
  reader = FARMReader(model_name_or_path=reader_model,
255
  top_k = reader_top_k, use_gpu=True)
256
  semantic_search_pipeline = Pipeline()
257
+ if useQueryCheck and reader_model:
258
  querycheck = QueryCheck()
259
  semantic_search_pipeline.add_node(component = querycheck, name = "QueryCheck",
260
  inputs = ["Query"])
 
262
  inputs = ["QueryCheck.output_1"])
263
  semantic_search_pipeline.add_node(component = reader, name = "FARMReader",
264
  inputs= ["EmbeddingRetriever"])
265
+ elif reader_model :
266
  semantic_search_pipeline.add_node(component = retriever, name = "EmbeddingRetriever",
267
  inputs = ["Query"])
268
  semantic_search_pipeline.add_node(component = reader, name = "FARMReader",
269
  inputs= ["EmbeddingRetriever"])
270
+ else:
271
+ semantic_search_pipeline.add_node(component = retriever, name = "EmbeddingRetriever",
272
+ inputs = ["Query"])
273
+
274
 
275
  return semantic_search_pipeline, document_store
276