Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Literal type hint #156

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion haystack/api/controller/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
retriever = EmbeddingRetriever(
document_store=document_store,
embedding_model=EMBEDDING_MODEL_PATH,
model_format=EMBEDDING_MODEL_FORMAT, # type: ignore
model_format=EMBEDDING_MODEL_FORMAT,
gpu=USE_GPU
) # type: BaseRetriever
else:
Expand Down
5 changes: 2 additions & 3 deletions haystack/retriever/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import List, Union

from farm.infer import Inferencer
from typing_extensions import Literal

from haystack.database.base import Document
from haystack.database.elasticsearch import ElasticsearchDocumentStore
Expand Down Expand Up @@ -108,8 +107,8 @@ def __init__(
document_store: ElasticsearchDocumentStore,
embedding_model: str,
gpu: bool = True,
model_format: Literal["farm", "transformers", "sentence_transformers"] = "farm",
pooling_strategy: Literal["cls_token", "reduce_mean", "reduce_max", "per_token", "s3e"] = "reduce_mean",
model_format: str = "farm",
pooling_strategy: str = "reduce_mean",
emb_extraction_layer: int = -1,
):
"""
Expand Down