diff --git a/example/audio_2023-10-26_14-05-12.ogg b/example/audio_2023-10-26_14-05-12.ogg new file mode 100644 index 0000000..b8058f3 Binary files /dev/null and b/example/audio_2023-10-26_14-05-12.ogg differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..bca234b --- /dev/null +++ b/main.py @@ -0,0 +1,19 @@ +import whisper +import time +from fastapi import FastAPI +from pydantic import BaseModel +app = FastAPI() + +@app.get("/") +def read_main(): + return {"message": "This is your main app"} +class Response(BaseModel): + path: str + + +model = whisper.load_model("medium") +@app.post("/voice2txt/") +def calculate_api(response: Response): + path = response.path + result = model.transcribe(path)["text"] + return {"message": result} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..99b91ca --- /dev/null +++ b/requirements.txt @@ -0,0 +1,128 @@ +aiohttp==3.8.6 +aiosignal==1.3.1 +alembic==1.12.1 +annotated-types==0.6.0 +antlr4-python3-runtime==4.9.3 +anyio==3.7.1 +asteroid-filterbanks==0.4.0 +async-timeout==4.0.3 +attrs==23.1.0 +audioread==3.0.1 +certifi==2023.7.22 +cffi==1.16.0 +charset-normalizer==3.3.1 +click==8.1.7 +cmake==3.27.7 +colorama==0.4.6 +coloredlogs==15.0.1 +colorlog==6.7.0 +contourpy==1.1.1 +cycler==0.12.1 +datasets==2.14.6 +decorator==5.1.1 +dill==0.3.7 +docopt==0.6.2 +einops==0.7.0 +fastapi==0.104.0 +filelock==3.12.4 +flatbuffers==23.5.26 +fonttools==4.43.1 +frozenlist==1.4.0 +fsspec==2023.10.0 +greenlet==3.0.1 +h11==0.14.0 +huggingface-hub==0.17.3 +humanfriendly==10.0 +HyperPyYAML==1.2.2 +idna==3.4 +Jinja2==3.1.2 +joblib==1.3.2 +julius==0.2.7 +kiwisolver==1.4.5 +lazy_loader==0.3 +librosa==0.10.1 +lightning==2.1.0 +lightning-utilities==0.9.0 +lit==17.0.3 +llvmlite==0.41.1 +Mako==1.2.4 +markdown-it-py==3.0.0 +MarkupSafe==2.1.2 +matplotlib==3.8.0 +mdurl==0.1.2 +more-itertools==10.1.0 +mpmath==1.3.0 +msgpack==1.0.7 +multidict==6.0.4 +multiprocess==0.70.15 +networkx==3.0 +numba==0.58.1 +numpy==1.26.1 +omegaconf==2.3.0 +onnxruntime-gpu==1.16.1 +openai-whisper==20230918 +optuna==3.4.0 +packaging==23.2 +pandas==2.1.1 +Pillow==9.3.0 +platformdirs==3.11.0 +pooch==1.8.0 +primePy==1.3 +protobuf==4.24.4 +pyannote.audio==3.0.1 +pyannote.core==5.0.0 +pyannote.database==5.0.1 +pyannote.metrics==3.2.1 +pyannote.pipeline==3.0.1 +pyarrow==13.0.0 +pycparser==2.21 +pydantic==2.4.2 +pydantic_core==2.10.1 +Pygments==2.16.1 +pyparsing==3.1.1 +python-dateutil==2.8.2 +pytorch-lightning==2.1.0 +pytorch-metric-learning==2.3.0 +pytz==2023.3.post1 +PyYAML==6.0.1 +regex==2023.10.3 +requests==2.31.0 +rich==13.6.0 +ruamel.yaml==0.18.2 +ruamel.yaml.clib==0.2.8 +safetensors==0.4.0 +scikit-learn==1.3.2 +scipy==1.11.3 +semver==3.0.2 +sentencepiece==0.1.99 +shellingham==1.5.4 +six==1.16.0 +sniffio==1.3.0 +sortedcontainers==2.4.0 +soundfile==0.12.1 +soxr==0.3.7 +speechbrain==0.5.15 +SQLAlchemy==2.0.22 +starlette==0.27.0 +sympy==1.12 +tabulate==0.9.0 +tensorboardX==2.6.2.2 +threadpoolctl==3.2.0 +tiktoken==0.3.3 +tokenizers==0.14.1 +torch==2.1.0+cpu +torch-audiomentations==0.11.0 +torch-pitch-shift==1.2.4 +torchaudio==2.1.0+cpu +torchmetrics==1.2.0 +torchvision==0.16.0+cpu +tqdm==4.66.1 +transformers==4.34.1 +triton==2.0.0 +typer==0.9.0 +typing_extensions==4.8.0 +tzdata==2023.3 +urllib3==2.0.7 +uvicorn==0.23.2 +xxhash==3.4.1 +yarl==1.9.2 diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..0b6293f --- /dev/null +++ b/run.sh @@ -0,0 +1 @@ +uvicorn main:app --reload --port 7860 \ No newline at end of file