index
int64
0
0
repo_id
stringclasses
351 values
file_path
stringlengths
26
186
content
stringlengths
1
990k
0
hf_public_repos/api-inference-community/docker_images/sklearn/tests/generators
hf_public_repos/api-inference-community/docker_images/sklearn/tests/generators/samples/tabularregression-linear_regression-1.0-output.json
[ 139.54831330342856, 179.52030577879273, 134.04133297819817, 291.4119359771987, 123.78723656395928, 92.17357676591854, 258.2340970376254, 181.33895237832277, 90.22217861672894, 108.63143297584902 ]
0
hf_public_repos/api-inference-community/docker_images/sklearn/tests/generators
hf_public_repos/api-inference-community/docker_images/sklearn/tests/generators/samples/iris-hist_gradient_boosting-1.0-output.json
[ 1, 0, 2, 1, 1, 0, 1, 2, 1, 1 ]
0
hf_public_repos/api-inference-community/docker_images/sklearn/tests/generators
hf_public_repos/api-inference-community/docker_images/sklearn/tests/generators/samples/tabularregression-1.0-input.json
{ "data": { "age": [ 0.0453409833354632, 0.0925639831987174, 0.063503675590561, 0.096196521649737, 0.0126481372762872, 0.00901559882526763, -0.00914709342983014, -0.0236772472339084, -0.0926954778032799, -0.0600026317441039 ], "sex": [ -0.0...
0
hf_public_repos/api-inference-community/docker_images/sklearn/tests/generators
hf_public_repos/api-inference-community/docker_images/sklearn/tests/generators/samples/textclassification-latest-input.json
{ "data": [ "From: krs@allegra.att.com (K. R. Subramanian)\nSubject: Companies involved with Scientific Visualization...\nReply-To: krs@allegra.att.com\nOrganization: AT&T Bell Laboratories\nLines: 10\n\nIf anyone has a list of companies doing data visualization (software\nor hardware) I would like to hear from t...
0
hf_public_repos/api-inference-community/docker_images/sklearn/tests/generators
hf_public_repos/api-inference-community/docker_images/sklearn/tests/generators/samples/iris-logistic_regression-1.0-output.json
[ 1, 0, 2, 1, 1, 0, 1, 2, 1, 1 ]
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/asteroid/Dockerfile
FROM tiangolo/uvicorn-gunicorn:python3.8 LABEL maintainer="me <me@example.com>" # Add any system dependency here # RUN apt-get update -y && apt-get install libXXX -y RUN apt-get update -y && apt-get install ffmpeg -y COPY ./requirements.txt /app RUN pip install --no-cache-dir -r requirements.txt COPY ./prestart.sh /a...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/asteroid/requirements.txt
starlette==0.27.0 api-inference-community==0.0.23 huggingface_hub==0.5.1 asteroid==0.4.4
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/asteroid/prestart.sh
python app/main.py
0
hf_public_repos/api-inference-community/docker_images/asteroid
hf_public_repos/api-inference-community/docker_images/asteroid/app/main.py
import functools import logging import os from typing import Dict, Type from api_inference_community.routes import pipeline_route, status_ok from app.pipelines import AudioSourceSeparationPipeline, AudioToAudioPipeline, Pipeline from starlette.applications import Starlette from starlette.middleware import Middleware f...
0
hf_public_repos/api-inference-community/docker_images/asteroid/app
hf_public_repos/api-inference-community/docker_images/asteroid/app/pipelines/audio_to_audio.py
from typing import List, Tuple import numpy as np from app.pipelines import Pipeline from asteroid import separate from asteroid.models import BaseModel class AudioToAudioPipeline(Pipeline): def __init__(self, model_id: str): self.model = BaseModel.from_pretrained(model_id) self.sampling_rate = s...
0
hf_public_repos/api-inference-community/docker_images/asteroid/app
hf_public_repos/api-inference-community/docker_images/asteroid/app/pipelines/base.py
from abc import ABC, abstractmethod from typing import Any class Pipeline(ABC): @abstractmethod def __init__(self, model_id: str): raise NotImplementedError("Pipelines should implement an __init__ method") @abstractmethod def __call__(self, inputs: Any) -> Any: raise NotImplementedErr...
0
hf_public_repos/api-inference-community/docker_images/asteroid/app
hf_public_repos/api-inference-community/docker_images/asteroid/app/pipelines/audio_source_separation.py
from typing import Tuple import numpy as np from app.pipelines import Pipeline from asteroid import separate from asteroid.models import BaseModel class AudioSourceSeparationPipeline(Pipeline): def __init__(self, model_id: str): self.model = BaseModel.from_pretrained(model_id) self.sampling_rate ...
0
hf_public_repos/api-inference-community/docker_images/asteroid/app
hf_public_repos/api-inference-community/docker_images/asteroid/app/pipelines/__init__.py
from app.pipelines.base import Pipeline, PipelineException # isort:skip from app.pipelines.audio_source_separation import AudioSourceSeparationPipeline from app.pipelines.audio_to_audio import AudioToAudioPipeline
0
hf_public_repos/api-inference-community/docker_images/asteroid
hf_public_repos/api-inference-community/docker_images/asteroid/tests/test_docker_build.py
import os import subprocess from unittest import TestCase class cd: """Context manager for changing the current working directory""" def __init__(self, newPath): self.newPath = os.path.expanduser(newPath) def __enter__(self): self.savedPath = os.getcwd() os.chdir(self.newPath) ...
0
hf_public_repos/api-inference-community/docker_images/asteroid
hf_public_repos/api-inference-community/docker_images/asteroid/tests/test_api.py
import os from typing import Dict from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS, get_pipeline # Must contain at least one example of each implemented pipeline # Tests do not check the actual values of the model output, so small dummy # models are recommended for faster tests. TESTABLE_MODE...
0
hf_public_repos/api-inference-community/docker_images/asteroid
hf_public_repos/api-inference-community/docker_images/asteroid/tests/test_api_audio_source_separation.py
import os from unittest import TestCase, skipIf from api_inference_community.validation import ffmpeg_read from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "audio-source-separation" not in ALLOWED_TASKS, "audio-source-separatio...
0
hf_public_repos/api-inference-community/docker_images/asteroid
hf_public_repos/api-inference-community/docker_images/asteroid/tests/test_api_audio_to_audio.py
import base64 import json import os from unittest import TestCase, skipIf from api_inference_community.validation import ffmpeg_read from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "audio-to-audio" not in ALLOWED_TASKS, "audio...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/adapter_transformers/Dockerfile
FROM tiangolo/uvicorn-gunicorn:python3.8 LABEL maintainer="me <me@example.com>" # Add any system dependency here # RUN apt-get update -y && apt-get install libXXX -y COPY ./requirements.txt /app RUN pip install --no-cache-dir -r requirements.txt COPY ./prestart.sh /app/ # Most DL models are quite large in terms of ...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/adapter_transformers/requirements.txt
starlette==0.37.2 api-inference-community==0.0.32 torch==2.3.0 adapters==0.2.1 huggingface_hub==0.23.0
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/adapter_transformers/prestart.sh
python app/main.py
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app/batch.py
#!/usr/bin/env python import os from api_inference_community.batch import batch from app.main import get_pipeline DATASET_NAME = os.getenv("DATASET_NAME") DATASET_CONFIG = os.getenv("DATASET_CONFIG", None) DATASET_SPLIT = os.getenv("DATASET_SPLIT") DATASET_COLUMN = os.getenv("DATASET_COLUMN") USE_GPU = os.getenv("U...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app/main.py
import functools import logging import os from typing import Dict, Type from api_inference_community.routes import pipeline_route, status_ok from app.pipelines import ( Pipeline, QuestionAnsweringPipeline, SummarizationPipeline, TextClassificationPipeline, TextGenerationPipeline, TokenClassific...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app/pipelines/token_classification.py
from typing import Any, Dict, List import numpy as np from app.pipelines import Pipeline from transformers import ( TokenClassificationPipeline as TransformersTokenClassificationPipeline, ) class TokenClassificationPipeline(Pipeline): def __init__( self, adapter_id: str, ): self.p...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app/pipelines/summarization.py
from typing import Dict, List from app.pipelines import Pipeline from transformers import SummarizationPipeline as TransformersSummarizationPipeline class SummarizationPipeline(Pipeline): def __init__(self, adapter_id: str): self.pipeline = self._load_pipeline_instance( TransformersSummarizat...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app/pipelines/text_generation.py
from typing import Dict, List from app.pipelines import Pipeline from transformers import TextGenerationPipeline as TransformersTextGenerationPipeline class TextGenerationPipeline(Pipeline): def __init__(self, adapter_id: str): self.pipeline = self._load_pipeline_instance( TransformersTextGen...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app/pipelines/base.py
from abc import ABC, abstractmethod from typing import Any from adapters import AutoAdapterModel, get_adapter_info from transformers import AutoTokenizer from transformers.pipelines.base import logger class Pipeline(ABC): @abstractmethod def __init__(self, model_id: str): raise NotImplementedError("P...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app/pipelines/question_answering.py
from typing import Any, Dict from app.pipelines import Pipeline from transformers import QuestionAnsweringPipeline as TransformersQAPipeline class QuestionAnsweringPipeline(Pipeline): def __init__( self, adapter_id: str, ): self.pipeline = self._load_pipeline_instance(TransformersQAPi...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app/pipelines/__init__.py
from app.pipelines.base import Pipeline, PipelineException # isort:skip from app.pipelines.question_answering import QuestionAnsweringPipeline from app.pipelines.summarization import SummarizationPipeline from app.pipelines.text_classification import TextClassificationPipeline from app.pipelines.text_generation impor...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app
hf_public_repos/api-inference-community/docker_images/adapter_transformers/app/pipelines/text_classification.py
from typing import Dict, List from app.pipelines import Pipeline from transformers import ( TextClassificationPipeline as TransformersClassificationPipeline, ) class TextClassificationPipeline(Pipeline): def __init__( self, adapter_id: str, ): self.pipeline = self._load_pipeline_i...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers
hf_public_repos/api-inference-community/docker_images/adapter_transformers/tests/test_api_token_classification.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "token-classification" not in ALLOWED_TASKS, "token-classification not implemented", ) class TokenClassificationTestCa...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers
hf_public_repos/api-inference-community/docker_images/adapter_transformers/tests/test_api_text_generation.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "text-generation" not in ALLOWED_TASKS, "text-generation not implemented", ) class TextGenerationTestCase(TestCase): ...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers
hf_public_repos/api-inference-community/docker_images/adapter_transformers/tests/test_docker_build.py
import os import subprocess from unittest import TestCase class cd: """Context manager for changing the current working directory""" def __init__(self, newPath): self.newPath = os.path.expanduser(newPath) def __enter__(self): self.savedPath = os.getcwd() os.chdir(self.newPath) ...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers
hf_public_repos/api-inference-community/docker_images/adapter_transformers/tests/test_api_summarization.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "summarization" not in ALLOWED_TASKS, "summarization not implemented", ) class SummarizationTestCase(TestCase): de...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers
hf_public_repos/api-inference-community/docker_images/adapter_transformers/tests/test_api.py
import os from typing import Dict from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS, get_pipeline # Must contain at least one example of each implemented pipeline # Tests do not check the actual values of the model output, so small dummy # models are recommended for faster tests. TESTABLE_MODE...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers
hf_public_repos/api-inference-community/docker_images/adapter_transformers/tests/test_api_question_answering.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "question-answering" not in ALLOWED_TASKS, "question-answering not implemented", ) class QuestionAnsweringTestCase(Tes...
0
hf_public_repos/api-inference-community/docker_images/adapter_transformers
hf_public_repos/api-inference-community/docker_images/adapter_transformers/tests/test_api_text_classification.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "text-classification" not in ALLOWED_TASKS, "text-classification not implemented", ) class TextClassificationTestCase(...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/fasttext/Dockerfile
FROM tiangolo/uvicorn-gunicorn:python3.8 LABEL maintainer="me <me@example.com>" # Add any system dependency here # RUN apt-get update -y && apt-get install libXXX -y COPY ./requirements.txt /app RUN pip install --no-cache-dir -r requirements.txt COPY ./prestart.sh /app/ # Most DL models are quite large in terms of ...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/fasttext/requirements.txt
starlette==0.27.0 api-inference-community==0.0.23 fasttext==0.9.2 huggingface_hub==0.5.1 # Dummy change.
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/fasttext/prestart.sh
python app/main.py
0
hf_public_repos/api-inference-community/docker_images/fasttext
hf_public_repos/api-inference-community/docker_images/fasttext/app/main.py
import functools import logging import os from typing import Dict, Type from api_inference_community.routes import pipeline_route, status_ok from app.pipelines import ( FeatureExtractionPipeline, Pipeline, TextClassificationPipeline, ) from starlette.applications import Starlette from starlette.middleware ...
0
hf_public_repos/api-inference-community/docker_images/fasttext/app
hf_public_repos/api-inference-community/docker_images/fasttext/app/pipelines/feature_extraction.py
from typing import List from app.pipelines import Pipeline class FeatureExtractionPipeline(Pipeline): def __init__( self, model_id: str, ): # IMPLEMENT_THIS # Preload all the elements you are going to need at inference. # For instance your model, processors, tokenizer ...
0
hf_public_repos/api-inference-community/docker_images/fasttext/app
hf_public_repos/api-inference-community/docker_images/fasttext/app/pipelines/base.py
from abc import ABC, abstractmethod from typing import Any import fasttext from huggingface_hub import hf_hub_download class Pipeline(ABC): @abstractmethod def __init__(self, model_id: str): model_path = hf_hub_download(model_id, "model.bin", library_name="fasttext") self.model = fasttext.loa...
0
hf_public_repos/api-inference-community/docker_images/fasttext/app
hf_public_repos/api-inference-community/docker_images/fasttext/app/pipelines/__init__.py
from app.pipelines.base import Pipeline, PipelineException # isort:skip from app.pipelines.feature_extraction import FeatureExtractionPipeline from app.pipelines.text_classification import TextClassificationPipeline
0
hf_public_repos/api-inference-community/docker_images/fasttext/app
hf_public_repos/api-inference-community/docker_images/fasttext/app/pipelines/text_classification.py
from typing import Dict, List from app.pipelines import Pipeline from huggingface_hub import HfApi FASTTEXT_PREFIX_LENGTH = 9 # fasttext labels are formatted like "__label__eng_Latn" class TextClassificationPipeline(Pipeline): def __init__( self, model_id: str, ): super().__init__(...
0
hf_public_repos/api-inference-community/docker_images/fasttext
hf_public_repos/api-inference-community/docker_images/fasttext/tests/test_api_feature_extraction.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "feature-extraction" not in ALLOWED_TASKS, "feature-extraction not implemented", ) class FeatureExtractionTestCase(Tes...
0
hf_public_repos/api-inference-community/docker_images/fasttext
hf_public_repos/api-inference-community/docker_images/fasttext/tests/test_docker_build.py
import os import subprocess from unittest import TestCase class cd: """Context manager for changing the current working directory""" def __init__(self, newPath): self.newPath = os.path.expanduser(newPath) def __enter__(self): self.savedPath = os.getcwd() os.chdir(self.newPath) ...
0
hf_public_repos/api-inference-community/docker_images/fasttext
hf_public_repos/api-inference-community/docker_images/fasttext/tests/test_api.py
import os from typing import Dict, List from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS, get_pipeline # Must contain at least one example of each implemented pipeline # Tests do not check the actual values of the model output, so small dummy # models are recommended for faster tests. TESTABL...
0
hf_public_repos/api-inference-community/docker_images/fasttext
hf_public_repos/api-inference-community/docker_images/fasttext/tests/test_api_text_classification.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from parameterized import parameterized_class from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "text-classification" not in ALLOWED_TASKS, "text-classification not imp...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/sentence_transformers/Dockerfile
FROM tiangolo/uvicorn-gunicorn:python3.8 LABEL maintainer="Omar <omar@huggingface.co>" # Add any system dependency here # RUN apt-get update -y && apt-get install libXXX -y RUN pip3 install --no-cache-dir torch==1.13.0 COPY ./requirements.txt /app RUN pip install --no-cache-dir -r requirements.txt COPY ./prestart.s...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/sentence_transformers/requirements.txt
starlette==0.27.0 api-inference-community==0.0.32 sentence-transformers==3.0.1 transformers==4.41.1 tokenizers==0.19.1 protobuf==3.18.3 huggingface_hub==0.23.3 sacremoses==0.0.53 # dummy.
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/sentence_transformers/prestart.sh
python app/main.py
0
hf_public_repos/api-inference-community/docker_images/sentence_transformers
hf_public_repos/api-inference-community/docker_images/sentence_transformers/app/main.py
import functools import logging import os from typing import Dict, Type from api_inference_community.routes import pipeline_route, status_ok from app.pipelines import ( FeatureExtractionPipeline, Pipeline, SentenceSimilarityPipeline, ) from starlette.applications import Starlette from starlette.middleware ...
0
hf_public_repos/api-inference-community/docker_images/sentence_transformers/app
hf_public_repos/api-inference-community/docker_images/sentence_transformers/app/pipelines/feature_extraction.py
import os from typing import List from app.pipelines import Pipeline from sentence_transformers import SentenceTransformer class FeatureExtractionPipeline(Pipeline): def __init__( self, model_id: str, ): self.model = SentenceTransformer( model_id, use_auth_token=os.getenv(...
0
hf_public_repos/api-inference-community/docker_images/sentence_transformers/app
hf_public_repos/api-inference-community/docker_images/sentence_transformers/app/pipelines/base.py
from abc import ABC, abstractmethod from typing import Any class Pipeline(ABC): @abstractmethod def __init__(self, model_id: str): raise NotImplementedError("Pipelines should implement an __init__ method") @abstractmethod def __call__(self, inputs: Any) -> Any: raise NotImplementedErr...
0
hf_public_repos/api-inference-community/docker_images/sentence_transformers/app
hf_public_repos/api-inference-community/docker_images/sentence_transformers/app/pipelines/sentence_similarity.py
import os from typing import Dict, List, Union from app.pipelines import Pipeline from sentence_transformers import SentenceTransformer, util class SentenceSimilarityPipeline(Pipeline): def __init__( self, model_id: str, ): self.model = SentenceTransformer( model_id, use_a...
0
hf_public_repos/api-inference-community/docker_images/sentence_transformers/app
hf_public_repos/api-inference-community/docker_images/sentence_transformers/app/pipelines/__init__.py
from app.pipelines.base import Pipeline, PipelineException # isort:skip from app.pipelines.feature_extraction import FeatureExtractionPipeline from app.pipelines.sentence_similarity import SentenceSimilarityPipeline
0
hf_public_repos/api-inference-community/docker_images/sentence_transformers
hf_public_repos/api-inference-community/docker_images/sentence_transformers/tests/test_api_feature_extraction.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "feature-extraction" not in ALLOWED_TASKS, "feature-extraction not implemented", ) class FeatureExtractionTestCase(Tes...
0
hf_public_repos/api-inference-community/docker_images/sentence_transformers
hf_public_repos/api-inference-community/docker_images/sentence_transformers/tests/test_docker_build.py
import os import subprocess from unittest import TestCase class cd: """Context manager for changing the current working directory""" def __init__(self, newPath): self.newPath = os.path.expanduser(newPath) def __enter__(self): self.savedPath = os.getcwd() os.chdir(self.newPath) ...
0
hf_public_repos/api-inference-community/docker_images/sentence_transformers
hf_public_repos/api-inference-community/docker_images/sentence_transformers/tests/test_api.py
import os from typing import Dict, List from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS, get_pipeline # Must contain at least one example of each implemented pipeline # Tests do not check the actual values of the model output, so small dummy # models are recommended for faster tests. TESTABL...
0
hf_public_repos/api-inference-community/docker_images/sentence_transformers
hf_public_repos/api-inference-community/docker_images/sentence_transformers/tests/test_api_sentence_similarity.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from parameterized import parameterized_class from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "feature-extraction" not in ALLOWED_TASKS, "feature-extraction not imple...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/spacy/Dockerfile
FROM tiangolo/uvicorn-gunicorn:python3.8 LABEL maintainer="Omar Sanseviero omar@huggingface.com" # Add any system dependency here # RUN apt-get update -y && apt-get install libXXX -y COPY ./requirements.txt /app RUN pip install --no-cache-dir -r requirements.txt COPY ./prestart.sh /app/ # Most DL models are quite l...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/spacy/requirements.txt
starlette==0.27.0 api-inference-community==0.0.23 huggingface_hub==0.5.1 requests==2.31.0
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/spacy/prestart.sh
python app/main.py
0
hf_public_repos/api-inference-community/docker_images/spacy
hf_public_repos/api-inference-community/docker_images/spacy/app/main.py
import functools import logging import os from typing import Dict, Type from api_inference_community.routes import pipeline_route, status_ok from app.pipelines import ( Pipeline, SentenceSimilarityPipeline, TextClassificationPipeline, TokenClassificationPipeline, ) from starlette.applications import St...
0
hf_public_repos/api-inference-community/docker_images/spacy/app
hf_public_repos/api-inference-community/docker_images/spacy/app/pipelines/token_classification.py
import os import subprocess import sys from typing import Any, Dict, List from app.pipelines import Pipeline class TokenClassificationPipeline(Pipeline): def __init__( self, model_id: str, ): # At the time, only public models from spaCy are allowed in the inference API. full_m...
0
hf_public_repos/api-inference-community/docker_images/spacy/app
hf_public_repos/api-inference-community/docker_images/spacy/app/pipelines/base.py
from abc import ABC, abstractmethod from typing import Any class Pipeline(ABC): @abstractmethod def __init__(self, model_id: str): raise NotImplementedError("Pipelines should implement an __init__ method") @abstractmethod def __call__(self, inputs: Any) -> Any: raise NotImplementedErr...
0
hf_public_repos/api-inference-community/docker_images/spacy/app
hf_public_repos/api-inference-community/docker_images/spacy/app/pipelines/sentence_similarity.py
import os import subprocess import sys from typing import Dict, List, Union from app.pipelines import Pipeline class SentenceSimilarityPipeline(Pipeline): def __init__( self, model_id: str, ): # At the time, only public models from spaCy are allowed in the inference API. full_...
0
hf_public_repos/api-inference-community/docker_images/spacy/app
hf_public_repos/api-inference-community/docker_images/spacy/app/pipelines/__init__.py
from app.pipelines.base import Pipeline, PipelineException # isort:skip from app.pipelines.sentence_similarity import SentenceSimilarityPipeline from app.pipelines.text_classification import TextClassificationPipeline from app.pipelines.token_classification import TokenClassificationPipeline
0
hf_public_repos/api-inference-community/docker_images/spacy/app
hf_public_repos/api-inference-community/docker_images/spacy/app/pipelines/text_classification.py
import os import subprocess import sys from typing import Dict, List from app.pipelines import Pipeline class TextClassificationPipeline(Pipeline): def __init__( self, model_id: str, ): # At the time, only public models from spaCy are allowed in the inference API. full_model_p...
0
hf_public_repos/api-inference-community/docker_images/spacy
hf_public_repos/api-inference-community/docker_images/spacy/tests/test_api_token_classification.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "token-classification" not in ALLOWED_TASKS, "token-classification not implemented", ) class TokenClassificationTestCa...
0
hf_public_repos/api-inference-community/docker_images/spacy
hf_public_repos/api-inference-community/docker_images/spacy/tests/test_docker_build.py
import os import subprocess from unittest import TestCase class cd: """Context manager for changing the current working directory""" def __init__(self, newPath): self.newPath = os.path.expanduser(newPath) def __enter__(self): self.savedPath = os.getcwd() os.chdir(self.newPath) ...
0
hf_public_repos/api-inference-community/docker_images/spacy
hf_public_repos/api-inference-community/docker_images/spacy/tests/test_api.py
import os from typing import Dict from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS, get_pipeline # Must contain at least one example of each implemented pipeline # Tests do not check the actual values of the model output, so small dummy # models are recommended for faster tests. TESTABLE_MODE...
0
hf_public_repos/api-inference-community/docker_images/spacy
hf_public_repos/api-inference-community/docker_images/spacy/tests/test_api_sentence_similarity.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "sentence-similarity" not in ALLOWED_TASKS, "sentence-similarity not implemented", ) class SentenceSimilarityTestCase(...
0
hf_public_repos/api-inference-community/docker_images/spacy
hf_public_repos/api-inference-community/docker_images/spacy/tests/test_api_text_classification.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "text-classification" not in ALLOWED_TASKS, "text-classification not implemented", ) class TextClassificationTestCase(...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/paddlenlp/Dockerfile
FROM tiangolo/uvicorn-gunicorn:python3.8 LABEL maintainer="PaddleNLP <paddlenlp@baidu.com>" # Add any system dependency here # RUN apt-get update -y && apt-get install libXXX -y COPY ./requirements.txt /app RUN pip install --no-cache-dir -r requirements.txt COPY ./prestart.sh /app/ # Most DL models are quite large ...
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/paddlenlp/requirements.txt
starlette==0.27.0 api-inference-community==0.0.27 huggingface_hub>=0.10.1 paddlepaddle==2.5.0 paddlenlp>=2.5.0 #Dummy
0
hf_public_repos/api-inference-community/docker_images
hf_public_repos/api-inference-community/docker_images/paddlenlp/prestart.sh
python app/main.py
0
hf_public_repos/api-inference-community/docker_images/paddlenlp
hf_public_repos/api-inference-community/docker_images/paddlenlp/app/main.py
import functools import logging import os from typing import Dict, Type from api_inference_community.routes import pipeline_route, status_ok from app.pipelines import ( ConversationalPipeline, FillMaskPipeline, Pipeline, SummarizationPipeline, ZeroShotClassificationPipeline, ) from starlette.applic...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp/app
hf_public_repos/api-inference-community/docker_images/paddlenlp/app/pipelines/summarization.py
from typing import Dict, List from app.pipelines import Pipeline from paddlenlp.taskflow import Taskflow class SummarizationPipeline(Pipeline): def __init__(self, model_id: str): self.taskflow = Taskflow( "text_summarization", task_path=model_id, from_hf_hub=True ) def __call__(s...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp/app
hf_public_repos/api-inference-community/docker_images/paddlenlp/app/pipelines/base.py
from abc import ABC, abstractmethod from typing import Any class Pipeline(ABC): @abstractmethod def __init__(self, model_id: str): raise NotImplementedError("Pipelines should implement an __init__ method") @abstractmethod def __call__(self, inputs: Any) -> Any: raise NotImplementedErr...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp/app
hf_public_repos/api-inference-community/docker_images/paddlenlp/app/pipelines/fill_mask.py
from typing import Any, Dict, List from app.pipelines import Pipeline from paddlenlp.taskflow import Taskflow class FillMaskPipeline(Pipeline): def __init__(self, model_id: str): self.taskflow = Taskflow("fill_mask", task_path=model_id, from_hf_hub=True) def __call__(self, inputs: str) -> List[Dict[...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp/app
hf_public_repos/api-inference-community/docker_images/paddlenlp/app/pipelines/conversational.py
from typing import Any, Dict, List, Union from app.pipelines import Pipeline from paddlenlp.taskflow import Taskflow class ConversationalPipeline(Pipeline): def __init__(self, model_id: str): self.pipeline = Taskflow("dialogue", task_path=model_id, from_hf_hub=True) def __call__(self, inputs: Dict[s...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp/app
hf_public_repos/api-inference-community/docker_images/paddlenlp/app/pipelines/zero_shot_classification.py
from typing import Any, Dict, List, Optional from app.pipelines import Pipeline from paddlenlp.taskflow import Taskflow class ZeroShotClassificationPipeline(Pipeline): def __init__(self, model_id: str): self.taskflow = Taskflow( "zero_shot_text_classification", task_path=model_id,...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp/app
hf_public_repos/api-inference-community/docker_images/paddlenlp/app/pipelines/__init__.py
from app.pipelines.base import Pipeline, PipelineException # isort:skip from app.pipelines.conversational import ConversationalPipeline from app.pipelines.fill_mask import FillMaskPipeline from app.pipelines.summarization import SummarizationPipeline from app.pipelines.zero_shot_classification import ZeroShotClassifi...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp
hf_public_repos/api-inference-community/docker_images/paddlenlp/tests/test_api_fill_mask.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from parameterized import parameterized_class from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "fill-mask" not in ALLOWED_TASKS, "fill-mask not implemented", ) @parame...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp
hf_public_repos/api-inference-community/docker_images/paddlenlp/tests/test_api_conversational.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from parameterized import parameterized_class from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "conversational" not in ALLOWED_TASKS, "conversational not implemented",...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp
hf_public_repos/api-inference-community/docker_images/paddlenlp/tests/test_api_zero_shot_classification.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from parameterized import parameterized_class from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "summarization" not in ALLOWED_TASKS, "summarization not implemented", )...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp
hf_public_repos/api-inference-community/docker_images/paddlenlp/tests/test_docker_build.py
import os import subprocess from unittest import TestCase class cd: """Context manager for changing the current working directory""" def __init__(self, newPath): self.newPath = os.path.expanduser(newPath) def __enter__(self): self.savedPath = os.getcwd() os.chdir(self.newPath) ...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp
hf_public_repos/api-inference-community/docker_images/paddlenlp/tests/test_api_summarization.py
import json import os from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS from parameterized import parameterized_class from starlette.testclient import TestClient from tests.test_api import TESTABLE_MODELS @skipIf( "summarization" not in ALLOWED_TASKS, "summarization not implemented", )...
0
hf_public_repos/api-inference-community/docker_images/paddlenlp
hf_public_repos/api-inference-community/docker_images/paddlenlp/tests/test_api.py
import os from typing import Dict from unittest import TestCase, skipIf from app.main import ALLOWED_TASKS, get_pipeline # Must contain at least one example of each implemented pipeline # Tests do not check the actual values of the model output, so small dummy # models are recommended for faster tests. TESTABLE_MODE...
0
hf_public_repos/api-inference-community
hf_public_repos/api-inference-community/scripts/export_tasks.py
"""Exports a library -> supported tasks mapping in JSON format. This script - parses the source code of a library's app/main.py and extracts the AST - finds the ALLOWED_TASKS variable and get all the keys. - prints the library name as well as its tasks in JSON format. Note that the transformer library is not include...
0
hf_public_repos
hf_public_repos/diffusers/setup.py
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
0
hf_public_repos
hf_public_repos/diffusers/Makefile
.PHONY: deps_table_update modified_only_fixup extra_style_checks quality style fixup fix-copies test test-examples # make sure to test the local checkout in scripts and not the pre-installed one (don't use quotes!) export PYTHONPATH = src check_dirs := examples scripts src tests utils benchmarks modified_only_fixup:...
0
hf_public_repos
hf_public_repos/diffusers/PHILOSOPHY.md
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
0
hf_public_repos
hf_public_repos/diffusers/LICENSE
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, ...
0
hf_public_repos
hf_public_repos/diffusers/MANIFEST.in
include LICENSE include src/diffusers/utils/model_card_template.md
0
hf_public_repos
hf_public_repos/diffusers/CONTRIBUTING.md
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
0
hf_public_repos
hf_public_repos/diffusers/CITATION.cff
cff-version: 1.2.0 title: 'Diffusers: State-of-the-art diffusion models' message: >- If you use this software, please cite it using the metadata from this file. type: software authors: - given-names: Patrick family-names: von Platen - given-names: Suraj family-names: Patil - given-names: Anton fam...
0
hf_public_repos
hf_public_repos/diffusers/README.md
<!--- Copyright 2022 - The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law o...
0
hf_public_repos
hf_public_repos/diffusers/pyproject.toml
[tool.ruff] line-length = 119 [tool.ruff.lint] # Never enforce `E501` (line length violations). ignore = ["C901", "E501", "E741", "F402", "F823"] select = ["C", "E", "F", "I", "W"] # Ignore import violations in all `__init__.py` files. [tool.ruff.lint.per-file-ignores] "__init__.py" = ["E402", "F401", "F403", "F811"]...