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 | hf_public_repos/api-inference-community/docker_images/doctr/prestart.sh | python app/main.py
|
0 | hf_public_repos/api-inference-community/docker_images/doctr | hf_public_repos/api-inference-community/docker_images/doctr/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 ObjectDetectionPipeline, Pipeline
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware.gzi... |
0 | hf_public_repos/api-inference-community/docker_images/doctr/app | hf_public_repos/api-inference-community/docker_images/doctr/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/doctr/app | hf_public_repos/api-inference-community/docker_images/doctr/app/pipelines/object_detection.py | from typing import Any, Dict, List
import torch
from app.pipelines import Pipeline
from doctr.models.obj_detection.factory import from_hub
from PIL import Image
from torchvision.transforms import Compose, ConvertImageDtype, PILToTensor
class ObjectDetectionPipeline(Pipeline):
def __init__(self, model_id: str):
... |
0 | hf_public_repos/api-inference-community/docker_images/doctr/app | hf_public_repos/api-inference-community/docker_images/doctr/app/pipelines/__init__.py | from app.pipelines.base import Pipeline, PipelineException # isort:skip
from app.pipelines.object_detection import ObjectDetectionPipeline
|
0 | hf_public_repos/api-inference-community/docker_images/doctr | hf_public_repos/api-inference-community/docker_images/doctr/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/doctr | hf_public_repos/api-inference-community/docker_images/doctr/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/doctr | hf_public_repos/api-inference-community/docker_images/doctr/tests/test_api_object_detection.py | import json
import os
from typing import Dict
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(
"object-detection" not in ALLOWED_TASKS,
"object... |
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/k2/Dockerfile | FROM tiangolo/uvicorn-gunicorn:python3.8
LABEL maintainer="Yenda <jtrmal@gmail.com>"
# Add any system dependency here
RUN apt-get update -y && apt-get install cmake ffmpeg -y && rm -rf /var/lib/apt/lists/*
COPY ./requirements.txt /app
RUN pip install --no-cache-dir torch==1.11.0+cpu torchvision==0.12.0+cpu torchaudio... |
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/k2/requirements.txt | starlette==0.27.0
api-inference-community==0.0.23
huggingface_hub==0.5.1
|
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/k2/prestart.sh | python app/main.py
|
0 | hf_public_repos/api-inference-community/docker_images/k2 | hf_public_repos/api-inference-community/docker_images/k2/app/common.py | import functools
import json
from typing import List, Optional, Union
import k2
import kaldifeat
import sentencepiece as spm
import torch
from huggingface_hub import HfApi, hf_hub_download
from sherpa import RnntConformerModel
from .decode import (
run_model_and_do_greedy_search,
run_model_and_do_modified_bea... |
0 | hf_public_repos/api-inference-community/docker_images/k2 | hf_public_repos/api-inference-community/docker_images/k2/app/decode.py | # Copyright 2022 Xiaomi Corp. (authors: Fangjun Kuang)
#
# See LICENSE for clarification regarding multiple authors
#
# 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:/... |
0 | hf_public_repos/api-inference-community/docker_images/k2 | hf_public_repos/api-inference-community/docker_images/k2/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 AutomaticSpeechRecognitionPipeline, Pipeline
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.mid... |
0 | hf_public_repos/api-inference-community/docker_images/k2/app | hf_public_repos/api-inference-community/docker_images/k2/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/k2/app | hf_public_repos/api-inference-community/docker_images/k2/app/pipelines/__init__.py | from app.pipelines.base import Pipeline, PipelineException # isort:skip
from app.pipelines.automatic_speech_recognition import (
AutomaticSpeechRecognitionPipeline,
)
|
0 | hf_public_repos/api-inference-community/docker_images/k2/app | hf_public_repos/api-inference-community/docker_images/k2/app/pipelines/automatic_speech_recognition.py | from typing import Dict
import app.common as cx
import numpy as np
import torch
from app.pipelines import Pipeline
torch.set_num_threads(1)
torch.set_num_interop_threads(1)
# See https://github.com/pytorch/pytorch/issues/38342
# and https://github.com/pytorch/pytorch/issues/33354
#
# If we don't do this, the delay ... |
0 | hf_public_repos/api-inference-community/docker_images/k2 | hf_public_repos/api-inference-community/docker_images/k2/tests/test_api_automatic_speech_recognition.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(
"automatic-speech-recognition" not in ALLOWED_TASKS,
"automatic-speech-r... |
0 | hf_public_repos/api-inference-community/docker_images/k2 | hf_public_repos/api-inference-community/docker_images/k2/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/k2 | hf_public_repos/api-inference-community/docker_images/k2/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 | hf_public_repos/api-inference-community/docker_images/espnet/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/espnet/requirements.txt | api-inference-community==0.0.32
huggingface_hub==0.18.0
espnet==202310
torch<2.0.1
torchaudio
torch_optimizer
espnet_model_zoo==0.1.7
|
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/espnet/prestart.sh | python app/main.py
|
0 | hf_public_repos/api-inference-community/docker_images/espnet | hf_public_repos/api-inference-community/docker_images/espnet/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 ( # AutomaticSpeechRecognitionPipeline,
AutomaticSpeechRecognitionPipeline,
Pipeline,
TextToSpeechPipeline,
)
from starlette.applications i... |
0 | hf_public_repos/api-inference-community/docker_images/espnet/app | hf_public_repos/api-inference-community/docker_images/espnet/app/pipelines/text_to_speech.py | from typing import Tuple
import numpy as np
from app.pipelines import Pipeline
from espnet2.bin.tts_inference import Text2Speech
class TextToSpeechPipeline(Pipeline):
def __init__(self, model_id: str):
self.model = Text2Speech.from_pretrained(model_id, device="cpu")
if hasattr(self.model, "fs"):... |
0 | hf_public_repos/api-inference-community/docker_images/espnet/app | hf_public_repos/api-inference-community/docker_images/espnet/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/espnet/app | hf_public_repos/api-inference-community/docker_images/espnet/app/pipelines/__init__.py | from app.pipelines.base import Pipeline, PipelineException # isort:skip
from app.pipelines.automatic_speech_recognition import (
AutomaticSpeechRecognitionPipeline,
)
from app.pipelines.text_to_speech import TextToSpeechPipeline
|
0 | hf_public_repos/api-inference-community/docker_images/espnet/app | hf_public_repos/api-inference-community/docker_images/espnet/app/pipelines/automatic_speech_recognition.py | from typing import Dict
import numpy as np
from app.pipelines import Pipeline
from espnet2.bin.asr_inference import Speech2Text
class AutomaticSpeechRecognitionPipeline(Pipeline):
def __init__(self, model_id: str):
self.model = Speech2Text.from_pretrained(model_id, device="cpu", beam_size=1)
self... |
0 | hf_public_repos/api-inference-community/docker_images/espnet | hf_public_repos/api-inference-community/docker_images/espnet/tests/test_api_automatic_speech_recognition.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(
"automatic-speech-recognition" not in ALLOWED_TASKS,
"automatic-speech-recognition not implemented",
)
class Automatic... |
0 | hf_public_repos/api-inference-community/docker_images/espnet | hf_public_repos/api-inference-community/docker_images/espnet/tests/test_api_text_to_speech.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(
"text-to-speech" not in ALLOWED_TASKS,
"text-to-speech not implemented"... |
0 | hf_public_repos/api-inference-community/docker_images/espnet | hf_public_repos/api-inference-community/docker_images/espnet/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/espnet | hf_public_repos/api-inference-community/docker_images/espnet/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 | hf_public_repos/api-inference-community/docker_images/timm/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/timm/requirements.txt | starlette==0.27.0
api-inference-community==0.0.32
huggingface_hub>=0.11.1
timm>=1.0.7
#dummy
|
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/timm/prestart.sh | python app/main.py
|
0 | hf_public_repos/api-inference-community/docker_images/timm | hf_public_repos/api-inference-community/docker_images/timm/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 ImageClassificationPipeline, Pipeline
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware... |
0 | hf_public_repos/api-inference-community/docker_images/timm/app | hf_public_repos/api-inference-community/docker_images/timm/app/pipelines/base.py | from abc import ABC, abstractmethod
from typing import Any, Optional
class Pipeline(ABC):
task: Optional[str] = None
model_id: Optional[str] = None
@abstractmethod
def __init__(self, model_id: str):
raise NotImplementedError("Pipelines should implement an __init__ method")
@abstractmetho... |
0 | hf_public_repos/api-inference-community/docker_images/timm/app | hf_public_repos/api-inference-community/docker_images/timm/app/pipelines/image_classification.py | from typing import Any, Dict, List
import timm
import torch
from app.pipelines import Pipeline
from PIL import Image
from timm.data import (
CustomDatasetInfo,
ImageNetInfo,
create_transform,
infer_imagenet_subset,
resolve_model_data_config,
)
class ImageClassificationPipeline(Pipeline):
def ... |
0 | hf_public_repos/api-inference-community/docker_images/timm/app | hf_public_repos/api-inference-community/docker_images/timm/app/pipelines/__init__.py | from app.pipelines.base import Pipeline, PipelineException # isort:skip
from app.pipelines.image_classification import ImageClassificationPipeline
|
0 | hf_public_repos/api-inference-community/docker_images/timm | hf_public_repos/api-inference-community/docker_images/timm/tests/test_api_image_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(
"image-classification" not in ALLOWED_TASKS,
"image-classification not i... |
0 | hf_public_repos/api-inference-community/docker_images/timm | hf_public_repos/api-inference-community/docker_images/timm/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/timm | hf_public_repos/api-inference-community/docker_images/timm/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 | hf_public_repos/api-inference-community/docker_images/nemo/Dockerfile | FROM tiangolo/uvicorn-gunicorn:python3.9
LABEL maintainer="me <me@example.com>"
# Add any system dependency here
RUN apt-get update -y && \
apt-get install libsndfile1 ffmpeg -y
# See PyTorch releases for pip here: https://download.pytorch.org/whl/torch_stable.html
COPY ./requirements.txt /app
RUN pip install htt... |
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/nemo/requirements.txt | starlette==0.28.0
api-inference-community==0.0.27
nemo_toolkit[all]>=1.18.1
huggingface_hub==0.15.1
# Dummy
|
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/nemo/prestart.sh | python app/main.py
|
0 | hf_public_repos/api-inference-community/docker_images/nemo | hf_public_repos/api-inference-community/docker_images/nemo/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
from app.pipelines.automatic_speech_recognition import (
AutomaticSpeechRecognitionPipeline,
)
from starlette.applications import Starlette... |
0 | hf_public_repos/api-inference-community/docker_images/nemo/app | hf_public_repos/api-inference-community/docker_images/nemo/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/nemo/app | hf_public_repos/api-inference-community/docker_images/nemo/app/pipelines/__init__.py | from app.pipelines.base import Pipeline, PipelineException # isort:skip
from app.pipelines.automatic_speech_recognition import (
AutomaticSpeechRecognitionPipeline,
)
|
0 | hf_public_repos/api-inference-community/docker_images/nemo/app | hf_public_repos/api-inference-community/docker_images/nemo/app/pipelines/automatic_speech_recognition.py | import os
import tempfile
import uuid
from typing import Dict
import librosa
import nemo.collections.asr as nemo_asr
import numpy as np
import soundfile
from app.pipelines import Pipeline
from huggingface_hub import hf_hub_download
from huggingface_hub.hf_api import HfFolder
class AutomaticSpeechRecognitionPipeline(... |
0 | hf_public_repos/api-inference-community/docker_images/nemo | hf_public_repos/api-inference-community/docker_images/nemo/tests/test_api_automatic_speech_recognition.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(
"automatic-speech-recognition" not in ALLOWED_TASKS,
"automatic-speech-recognition not implemented",
)
class Automatic... |
0 | hf_public_repos/api-inference-community/docker_images/nemo | hf_public_repos/api-inference-community/docker_images/nemo/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/nemo | hf_public_repos/api-inference-community/docker_images/nemo/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 | hf_public_repos/api-inference-community/docker_images/flair/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/flair/requirements.txt | starlette==0.27.0
pydantic==1.8.2
flair @ git+https://github.com/flairNLP/flair@e17ab1234fcfed2b089d8ef02b99949d520382d2
api-inference-community==0.0.25
|
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/flair/prestart.sh | python app/main.py
|
0 | hf_public_repos/api-inference-community/docker_images/flair | hf_public_repos/api-inference-community/docker_images/flair/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, TokenClassificationPipeline
from starlette.applications import Starlette
from starlette.routing import Route
logger = logging.getLogger(__na... |
0 | hf_public_repos/api-inference-community/docker_images/flair/app | hf_public_repos/api-inference-community/docker_images/flair/app/pipelines/token_classification.py | from typing import Any, Dict, List
from app.pipelines import Pipeline
from flair.data import Sentence, Span, Token
from flair.models import SequenceTagger
class TokenClassificationPipeline(Pipeline):
def __init__(
self,
model_id: str,
):
self.tagger = SequenceTagger.load(model_id)
... |
0 | hf_public_repos/api-inference-community/docker_images/flair/app | hf_public_repos/api-inference-community/docker_images/flair/app/pipelines/base.py | from abc import ABC, abstractmethod
from typing import Any, Optional
class Pipeline(ABC):
task: Optional[str] = None
model_id: Optional[str] = None
@abstractmethod
def __init__(self, model_id: str):
raise NotImplementedError("Pipelines should implement an __init__ method")
@abstractmetho... |
0 | hf_public_repos/api-inference-community/docker_images/flair/app | hf_public_repos/api-inference-community/docker_images/flair/app/pipelines/__init__.py | from app.pipelines.base import Pipeline, PipelineException # isort:skip
from app.pipelines.token_classification import TokenClassificationPipeline
|
0 | hf_public_repos/api-inference-community/docker_images/flair | hf_public_repos/api-inference-community/docker_images/flair/tests/test_api_token_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(
"token-classification" not in ALLOWED_TASKS,
"token-classification not i... |
0 | hf_public_repos/api-inference-community/docker_images/flair | hf_public_repos/api-inference-community/docker_images/flair/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/flair | hf_public_repos/api-inference-community/docker_images/flair/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 | hf_public_repos/api-inference-community/docker_images/span_marker/Dockerfile | FROM tiangolo/uvicorn-gunicorn:python3.8
LABEL maintainer="Tom Aarsen <ta.aarsen@gmail.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/span_marker/requirements.txt | starlette==0.27.0
api-inference-community==0.0.32
huggingface_hub>=0.17.3
span_marker>=1.4.0 |
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/span_marker/prestart.sh | python app/main.py
|
0 | hf_public_repos/api-inference-community/docker_images/span_marker | hf_public_repos/api-inference-community/docker_images/span_marker/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, TokenClassificationPipeline
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware... |
0 | hf_public_repos/api-inference-community/docker_images/span_marker/app | hf_public_repos/api-inference-community/docker_images/span_marker/app/pipelines/token_classification.py | from typing import Any, Dict, List
from app.pipelines import Pipeline
from span_marker import SpanMarkerModel
class TokenClassificationPipeline(Pipeline):
def __init__(
self,
model_id: str,
) -> None:
self.model = SpanMarkerModel.from_pretrained(model_id)
def __call__(self, input... |
0 | hf_public_repos/api-inference-community/docker_images/span_marker/app | hf_public_repos/api-inference-community/docker_images/span_marker/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/span_marker/app | hf_public_repos/api-inference-community/docker_images/span_marker/app/pipelines/__init__.py | from app.pipelines.base import Pipeline, PipelineException # isort:skip
from app.pipelines.token_classification import TokenClassificationPipeline
|
0 | hf_public_repos/api-inference-community/docker_images/span_marker | hf_public_repos/api-inference-community/docker_images/span_marker/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/span_marker | hf_public_repos/api-inference-community/docker_images/span_marker/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/span_marker | hf_public_repos/api-inference-community/docker_images/span_marker/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 | hf_public_repos/api-inference-community/docker_images/bertopic/Dockerfile | FROM tiangolo/uvicorn-gunicorn:python3.8
LABEL maintainer="Daniel van Strien <daniel@hf.co> "
# 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 larg... |
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/bertopic/requirements.txt | starlette==0.27.0
api-inference-community==0.0.25
huggingface_hub==0.14.0
bertopic==0.15.0
safetensors==0.3.1
|
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/bertopic/prestart.sh | python app/main.py
|
0 | hf_public_repos/api-inference-community/docker_images/bertopic | hf_public_repos/api-inference-community/docker_images/bertopic/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, TextClassificationPipeline
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware.... |
0 | hf_public_repos/api-inference-community/docker_images/bertopic/app | hf_public_repos/api-inference-community/docker_images/bertopic/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/bertopic/app | hf_public_repos/api-inference-community/docker_images/bertopic/app/pipelines/__init__.py | from app.pipelines.base import Pipeline, PipelineException # isort:skip
from app.pipelines.text_classification import TextClassificationPipeline
|
0 | hf_public_repos/api-inference-community/docker_images/bertopic/app | hf_public_repos/api-inference-community/docker_images/bertopic/app/pipelines/text_classification.py | from typing import Dict, List
from app.pipelines import Pipeline
from bertopic import BERTopic
class TextClassificationPipeline(Pipeline):
def __init__(
self,
model_id: str,
):
self.model = BERTopic.load(model_id)
def __call__(self, inputs: str) -> List[List[Dict[str, float]]]:
... |
0 | hf_public_repos/api-inference-community/docker_images/bertopic | hf_public_repos/api-inference-community/docker_images/bertopic/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/bertopic | hf_public_repos/api-inference-community/docker_images/bertopic/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/bertopic | hf_public_repos/api-inference-community/docker_images/bertopic/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/speechbrain/Dockerfile | FROM tiangolo/uvicorn-gunicorn:python3.9
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
RUN pip install --no-cache-dir torch==2.0
COPY ./requirements.txt /app
RUN pip install --no-cache-dir... |
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/speechbrain/requirements.txt | starlette==0.27.0
# TODO: Replace with the correct tag once the core PR is merged
api-inference-community==0.0.32
huggingface_hub>=0.7
transformers==4.30.0
git+https://github.com/speechbrain/speechbrain@v1.0.0
https://github.com/kpu/kenlm/archive/master.zip
pygtrie
#Dummy.
|
0 | hf_public_repos/api-inference-community/docker_images | hf_public_repos/api-inference-community/docker_images/speechbrain/prestart.sh | python app/main.py
|
0 | hf_public_repos/api-inference-community/docker_images/speechbrain | hf_public_repos/api-inference-community/docker_images/speechbrain/app/common.py | from enum import Enum
from huggingface_hub import HfApi
class ModelType(Enum):
# audio-to-audio
SEPFORMERSEPARATION = "SEPFORMERSEPARATION"
SPECTRALMASKENHANCEMENT = "SPECTRALMASKENHANCEMENT"
WAVEFORMENHANCEMENT = "WAVEFORMENHANCEMENT"
# automatic-speech-recognition
ENCODERASR = "ENCODERASR"
... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain | hf_public_repos/api-inference-community/docker_images/speechbrain/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 (
AudioClassificationPipeline,
AudioToAudioPipeline,
AutomaticSpeechRecognitionPipeline,
Pipeline,
TextToSpeechPipeline,
TextToT... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain/app | hf_public_repos/api-inference-community/docker_images/speechbrain/app/pipelines/audio_to_audio.py | from typing import List, Tuple
import numpy as np
import torch
from app.common import ModelType, get_type
from app.pipelines import Pipeline
from speechbrain.inference import (
SepformerSeparation,
SpectralMaskEnhancement,
WaveformEnhancement,
)
class AudioToAudioPipeline(Pipeline):
def __init__(self... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain/app | hf_public_repos/api-inference-community/docker_images/speechbrain/app/pipelines/audio_classification.py | from typing import Dict, List
import numpy as np
import torch
from app.common import ModelType, get_type
from app.pipelines import Pipeline
from speechbrain.inference import EncoderClassifier
class AudioClassificationPipeline(Pipeline):
def __init__(self, model_id: str):
model_type = get_type(model_id)
... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain/app | hf_public_repos/api-inference-community/docker_images/speechbrain/app/pipelines/text_to_speech.py | from typing import Tuple
import numpy as np
from app.common import ModelType, get_type, get_vocoder_model_id
from app.pipelines import Pipeline
from speechbrain.inference import HIFIGAN, FastSpeech2, Tacotron2
class TextToSpeechPipeline(Pipeline):
def __init__(self, model_id: str):
model_type = get_type(... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain/app | hf_public_repos/api-inference-community/docker_images/speechbrain/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/speechbrain/app | hf_public_repos/api-inference-community/docker_images/speechbrain/app/pipelines/text2text_generation.py | from typing import Dict, List
from app.common import ModelType, get_type
from app.pipelines import Pipeline
from speechbrain.inference import GraphemeToPhoneme
POSTPROCESSING = {ModelType.GRAPHEMETOPHONEME: lambda output: "-".join(output)}
class TextToTextPipeline(Pipeline):
def __init__(self, model_id: str):
... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain/app | hf_public_repos/api-inference-community/docker_images/speechbrain/app/pipelines/__init__.py | from app.pipelines.base import Pipeline, PipelineException # isort:skip
from app.pipelines.audio_classification import AudioClassificationPipeline
from app.pipelines.audio_to_audio import AudioToAudioPipeline
from app.pipelines.automatic_speech_recognition import (
AutomaticSpeechRecognitionPipeline,
)
from app.p... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain/app | hf_public_repos/api-inference-community/docker_images/speechbrain/app/pipelines/automatic_speech_recognition.py | from typing import Dict
import numpy as np
import torch
from app.common import ModelType, get_type
from app.pipelines import Pipeline
from speechbrain.inference import EncoderASR, EncoderDecoderASR, WhisperASR
class AutomaticSpeechRecognitionPipeline(Pipeline):
def __init__(self, model_id: str):
model_ty... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain | hf_public_repos/api-inference-community/docker_images/speechbrain/tests/test_api_automatic_speech_recognition.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(
"automatic-speech-recognition" not in ALLOWED_TASKS,
"automatic-speech-r... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain | hf_public_repos/api-inference-community/docker_images/speechbrain/tests/test_api_text_to_speech.py | import os
from unittest import TestCase, skipIf
from api_inference_community.validation import ffmpeg_read
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-to-speech" not in ALLOW... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain | hf_public_repos/api-inference-community/docker_images/speechbrain/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/speechbrain | hf_public_repos/api-inference-community/docker_images/speechbrain/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/speechbrain | hf_public_repos/api-inference-community/docker_images/speechbrain/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 parameterized import parameterized_class
from starlette.testclient import TestClient
from tests.test_api import TESTABLE_MODELS
@skipIf(
"au... |
0 | hf_public_repos/api-inference-community/docker_images/speechbrain | hf_public_repos/api-inference-community/docker_images/speechbrain/tests/test_api_audio_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(
"audio-classification" not in ALLOWED_TASKS,
"audio-classification not i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.