Skip to content

Commit

Permalink
Remove sentence similarity
Browse files Browse the repository at this point in the history
  • Loading branch information
osanseviero committed Jul 10, 2024
1 parent 0b6a3a9 commit d83076c
Show file tree
Hide file tree
Showing 30 changed files with 5 additions and 479 deletions.
7 changes: 0 additions & 7 deletions api_inference_community/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ class QuestionInputsCheck(BaseModel):
context: str


class SentenceSimilarityInputsCheck(BaseModel):
source_sentence: str
sentences: List[str]


class TableQuestionAnsweringInputsCheck(BaseModel):
table: Dict[str, List[str]]
query: str
Expand Down Expand Up @@ -139,7 +134,6 @@ class StringInput(RootModel):
"conversational": ConversationalInputsCheck,
"question-answering": QuestionInputsCheck,
"feature-extraction": StringOrStringBatchInputCheck,
"sentence-similarity": SentenceSimilarityInputsCheck,
"table-question-answering": TableQuestionAnsweringInputsCheck,
"tabular-classification": TabularDataInputsCheck,
"tabular-regression": TabularDataInputsCheck,
Expand Down Expand Up @@ -203,7 +197,6 @@ def check_inputs(inputs, tag):
"conversational",
"feature-extraction",
"question-answering",
"sentence-similarity",
"fill-mask",
"table-question-answering",
"tabular-classification",
Expand Down
1 change: 0 additions & 1 deletion docker_images/adapter_transformers/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"feature-extraction",
"image-classification",
"question-answering",
"sentence-similarity",
"structured-data-classification",
"text-generation",
"text-to-speech",
Expand Down
2 changes: 0 additions & 2 deletions docker_images/bertopic/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"feature-extraction",
"image-classification",
"question-answering",
"sentence-similarity",
"speech-segmentation",
"tabular-classification",
"tabular-regression",
Expand All @@ -29,7 +28,6 @@
"token-classification",
"conversational",
"feature-extraction",
"sentence-similarity",
"fill-mask",
"table-question-answering",
"summarization",
Expand Down
1 change: 0 additions & 1 deletion docker_images/common/app/pipelines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from app.pipelines.feature_extraction import FeatureExtractionPipeline
from app.pipelines.image_classification import ImageClassificationPipeline
from app.pipelines.question_answering import QuestionAnsweringPipeline
from app.pipelines.sentence_similarity import SentenceSimilarityPipeline
from app.pipelines.speech_segmentation import SpeechSegmentationPipeline
from app.pipelines.tabular_classification_pipeline import TabularClassificationPipeline
from app.pipelines.tabular_regression_pipeline import TabularRegressionPipeline
Expand Down
33 changes: 0 additions & 33 deletions docker_images/common/app/pipelines/sentence_similarity.py

This file was deleted.

2 changes: 0 additions & 2 deletions docker_images/common/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"feature-extraction",
"image-classification",
"question-answering",
"sentence-similarity",
"speech-segmentation",
"tabular-classification",
"tabular-regression",
Expand All @@ -31,7 +30,6 @@
"token-classification",
"conversational",
"feature-extraction",
"sentence-similarity",
"fill-mask",
"table-question-answering",
"summarization",
Expand Down
97 changes: 0 additions & 97 deletions docker_images/common/tests/test_api_sentence_similarity.py

This file was deleted.

2 changes: 0 additions & 2 deletions docker_images/diffusers/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"feature-extraction",
"image-classification",
"question-answering",
"sentence-similarity",
"speech-segmentation",
"tabular-classification",
"tabular-regression",
Expand All @@ -35,7 +34,6 @@
"conversational",
"feature-extraction",
"question-answering",
"sentence-similarity",
"fill-mask",
"table-question-answering",
"summarization",
Expand Down
1 change: 0 additions & 1 deletion docker_images/fasttext/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"image-classification",
"language-identification",
"question-answering",
"sentence-similarity",
"speech-segmentation",
"structured-data-classification",
"text-to-speech",
Expand Down
2 changes: 0 additions & 2 deletions docker_images/nemo/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"feature-extraction",
"image-classification",
"question-answering",
"sentence-similarity",
"speech-segmentation",
"structured-data-classification",
"text-classification",
Expand All @@ -31,7 +30,6 @@
"conversational",
"feature-extraction",
"question-answering",
"sentence-similarity",
"fill-mask",
"table-question-answering",
"summarization",
Expand Down
2 changes: 0 additions & 2 deletions docker_images/open_clip/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"feature-extraction",
"image-classification",
"question-answering",
"sentence-similarity",
"speech-segmentation",
"tabular-classification",
"tabular-regression",
Expand All @@ -35,7 +34,6 @@
"conversational",
"feature-extraction",
"question-answering",
"sentence-similarity",
"fill-mask",
"table-question-answering",
"summarization",
Expand Down
2 changes: 0 additions & 2 deletions docker_images/paddlenlp/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"feature-extraction",
"image-classification",
"question-answering",
"sentence-similarity",
"speech-segmentation",
"tabular-classification",
"tabular-regression",
Expand All @@ -34,7 +33,6 @@
"conversational",
"feature-extraction",
"question-answering",
"sentence-similarity",
"fill-mask",
"table-question-answering",
"summarization",
Expand Down
2 changes: 0 additions & 2 deletions docker_images/peft/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"feature-extraction",
"image-classification",
"question-answering",
"sentence-similarity",
"speech-segmentation",
"tabular-classification",
"tabular-regression",
Expand All @@ -29,7 +28,6 @@
"token-classification",
"conversational",
"feature-extraction",
"sentence-similarity",
"fill-mask",
"table-question-answering",
"summarization",
Expand Down
2 changes: 0 additions & 2 deletions docker_images/pyannote_audio/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"feature-extraction",
"image-classification",
"question-answering",
"sentence-similarity",
"speech-segmentation",
"structured-data-classification",
"text-classification",
Expand All @@ -30,7 +29,6 @@
"conversational",
"feature-extraction",
"question-answering",
"sentence-similarity",
"fill-mask",
"table-question-answering",
"summarization",
Expand Down
7 changes: 1 addition & 6 deletions docker_images/sentence_transformers/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
from typing import Dict, Type

from api_inference_community.routes import pipeline_route, status_ok
from app.pipelines import (
FeatureExtractionPipeline,
Pipeline,
SentenceSimilarityPipeline,
)
from app.pipelines import FeatureExtractionPipeline, Pipeline
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware.gzip import GZipMiddleware
Expand Down Expand Up @@ -38,7 +34,6 @@
# directories. Implement directly within the directories.
ALLOWED_TASKS: Dict[str, Type[Pipeline]] = {
"feature-extraction": FeatureExtractionPipeline,
"sentence-similarity": SentenceSimilarityPipeline,
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from app.pipelines.base import Pipeline, PipelineException # isort:skip

from app.pipelines.feature_extraction import FeatureExtractionPipeline
from app.pipelines.sentence_similarity import SentenceSimilarityPipeline

This file was deleted.

5 changes: 2 additions & 3 deletions docker_images/sentence_transformers/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# Tests do not check the actual values of the model output, so small dummy
# models are recommended for faster tests.
TESTABLE_MODELS: Dict[str, List[str]] = {
"feature-extraction": ["bert-base-uncased"],
"sentence-similarity": [
"feature-extraction": [
"bert-base-uncased",
"sentence-transformers/paraphrase-distilroberta-base-v1",
"sentence-transformers/paraphrase-xlm-r-multilingual-v1",
],
Expand All @@ -23,7 +23,6 @@
"feature-extraction",
"image-classification",
"question-answering",
"sentence-similarity",
"text-generation",
"text-to-speech",
}
Expand Down
Loading

0 comments on commit d83076c

Please sign in to comment.