Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

CPU spikes with attempting to transcribe blobs #491

Open
wisdomtooth546 opened this issue Dec 18, 2024 · 0 comments
Open

CPU spikes with attempting to transcribe blobs #491

wisdomtooth546 opened this issue Dec 18, 2024 · 0 comments

Comments

@wisdomtooth546
Copy link

wisdomtooth546 commented Dec 18, 2024

What is the current behavior?

Have noticed that the CPU spikes every time we attempt to transcribe any blob with `deepgram.listen.asyncrest.v("1").transcribe_file()` or `deepgram.listen.rest.v("1").transcribe_file()`. The bigger the blob, the sharper the spike. Interestingly, it doesn't spike with the deprecated `deepgram.listen.prerecorded.v("1").transcribe_file()`.

Steps to reproduce

I used a Jupyter Notebook to debug. I got its PID and tracked the `%CPU` using `top`. Every time I send a request via `deepgram.listen.asyncrest.v("1").transcribe_file()`, I can notice a sharp increase in the %CPU. I tried to transcribe an .mp3 of ~ 125MB and the %CPU spiked to >20%.

Expected behavior

Max 5% CPU usage

Please tell us about your environment

aenum==3.1.15 ; python_version >= "3.11" and python_version < "4.0"
aioboto3==13.2.0 ; python_version >= "3.11" and python_version < "4.0"
aiobotocore[boto3]==2.15.2 ; python_version >= "3.11" and python_version < "4.0"
aiofiles==23.2.1 ; python_version >= "3.11" and python_version < "4.0"
aiohappyeyeballs==2.4.4 ; python_version >= "3.11" and python_version < "4.0"
aiohttp==3.11.10 ; python_version >= "3.11" and python_version < "4.0"
aioitertools==0.12.0 ; python_version >= "3.11" and python_version < "4.0"
aiosignal==1.3.2 ; python_version >= "3.11" and python_version < "4.0"
annotated-types==0.7.0 ; python_version >= "3.11" and python_version < "4.0"
anthropic==0.23.1 ; python_version >= "3.11" and python_version < "4.0"
anyio==4.7.0 ; python_version >= "3.11" and python_version < "4.0"
apscheduler==3.11.0 ; python_version >= "3.11" and python_version < "4.0"
asgiref==3.8.1 ; python_version >= "3.11" and python_version < "4.0"
async-asgi-testclient==1.4.11 ; python_version >= "3.11" and python_version < "4.0"
async-timeout==5.0.1 ; python_version >= "3.11" and python_full_version < "3.11.3"
attrs==24.3.0 ; python_version >= "3.11" and python_version < "4.0"
backoff==2.2.1 ; python_version >= "3.11" and python_version < "4.0"
beanie==1.27.0 ; python_version >= "3.11" and python_version < "4.0"
boto3==1.35.36 ; python_version >= "3.11" and python_version < "4.0"
botocore==1.35.36 ; python_version >= "3.11" and python_version < "4.0"
bytecode==0.16.0 ; python_version >= "3.11.0" and python_version < "4.0"
cachecontrol==0.14.1 ; python_version >= "3.11" and python_version < "4.0"
cachetools==5.5.0 ; python_version >= "3.11" and python_version < "4.0"
certifi==2024.12.14 ; python_version >= "3.11" and python_version < "4.0"
cffi==1.17.1 ; python_version >= "3.11" and python_version < "4.0" and platform_python_implementation != "PyPy"
chardet==5.2.0 ; python_version >= "3.11" and python_version < "4.0"
charset-normalizer==3.4.0 ; python_version >= "3.11" and python_version < "4.0"
click==8.1.7 ; python_version >= "3.11" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.11" and python_version < "4.0" and (sys_platform == "win32" or platform_system == "Windows")
cryptography==43.0.3 ; python_version >= "3.11" and python_version < "4.0"
customerio==2.1 ; python_version >= "3.11" and python_version < "4.0"
dataclasses-json==0.6.7 ; python_version >= "3.11" and python_version < "4.0"
datadog==0.50.2 ; python_version >= "3.11" and python_version < "4.0"
ddtrace==2.17.3 ; python_version >= "3.11" and python_version < "4.0"
deepgram-sdk==3.7.7 ; python_version >= "3.11" and python_version < "4.0"
deprecated==1.2.15 ; python_version >= "3.11" and python_version < "4.0"
deprecation==2.1.0 ; python_version >= "3.11" and python_version < "4.0"
distro==1.9.0 ; python_version >= "3.11" and python_version < "4.0"
dnspython==2.7.0 ; python_version >= "3.11" and python_version < "4.0"
docstring-parser==0.16 ; python_version >= "3.11" and python_version < "4.0"
email-validator==2.2.0 ; python_version >= "3.11" and python_version < "4.0"
envier==0.6.1 ; python_version >= "3.11" and python_version < "4.0"
expiringdict==1.2.2 ; python_version >= "3.11" and python_version < "4.0"
faker==22.7.0 ; python_version >= "3.11" and python_version < "4.0"
fastapi-pagination==0.12.32 ; python_version >= "3.11" and python_version < "4.0"
fastapi==0.115.6 ; python_version >= "3.11" and python_version < "4.0"
ffmpeg-python==0.2.0 ; python_version >= "3.11" and python_version < "4.0"
filelock==3.16.1 ; python_version >= "3.11" and python_version < "4.0"
firebase-admin==6.6.0 ; python_version >= "3.11" and python_version < "4.0"
frozenlist==1.5.0 ; python_version >= "3.11" and python_version < "4.0"
fsspec==2024.10.0 ; python_version >= "3.11" and python_version < "4.0"
future==1.0.0 ; python_version >= "3.11" and python_version < "4.0"
gcloud-aio-auth==5.3.2 ; python_version >= "3.11" and python_version < "4.0"
gcloud-aio-storage==9.3.0 ; python_version >= "3.11" and python_version < "4.0"
google-api-core==2.24.0 ; python_version >= "3.11" and python_version < "4.0"
google-api-core[grpc]==2.24.0 ; python_version >= "3.11" and python_version < "4.0"
google-api-python-client==2.155.0 ; python_version >= "3.11" and python_version < "4.0"
google-auth-httplib2==0.2.0 ; python_version >= "3.11" and python_version < "4.0"
google-auth==2.37.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-aiplatform==1.71.1 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-aiplatform[all]==1.71.1 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-bigquery==3.27.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-core==2.4.1 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-firestore==2.19.0 ; python_version >= "3.11" and python_version < "4.0" and platform_python_implementation != "PyPy"
google-cloud-resource-manager==1.14.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-speech==2.29.0 ; python_version >= "3.11" and python_version < "4.0"
google-cloud-storage==2.19.0 ; python_version >= "3.11" and python_version < "4.0"
google-crc32c==1.6.0 ; python_version >= "3.11" and python_version < "4.0"
google-resumable-media==2.7.2 ; python_version >= "3.11" and python_version < "4.0"
googleapis-common-protos==1.66.0 ; python_version >= "3.11" and python_version < "4.0"
googleapis-common-protos[grpc]==1.66.0 ; python_version >= "3.11" and python_version < "4.0"
grpc-google-iam-v1==0.13.1 ; python_version >= "3.11" and python_version < "4.0"
grpcio-status==1.62.3 ; python_version >= "3.11" and python_version < "4.0"
grpcio==1.68.1 ; python_version >= "3.11" and python_version < "4.0"
gunicorn==22.0.0 ; python_version >= "3.11" and python_version < "4.0"
h11==0.14.0 ; python_version >= "3.11" and python_version < "4.0"
hiredis==3.1.0 ; python_version >= "3.11" and python_version < "4.0"
httpcore==1.0.7 ; python_version >= "3.11" and python_version < "4.0"
httplib2==0.22.0 ; python_version >= "3.11" and python_version < "4.0"
httptools==0.6.4 ; python_version >= "3.11" and python_version < "4.0"
httpx==0.25.2 ; python_version >= "3.11" and python_version < "4.0"
huggingface-hub==0.27.0 ; python_version >= "3.11" and python_version < "4.0"
idna==3.10 ; python_version >= "3.11" and python_version < "4.0"
importlib-metadata==7.1.0 ; python_version >= "3.11" and python_version < "4.0"
iniconfig==2.0.0 ; python_version >= "3.11" and python_version < "4.0"
jiter==0.8.2 ; python_version >= "3.11" and python_version < "4.0"
jmespath==1.0.1 ; python_version >= "3.11" and python_version < "4.0"
launchdarkly-eventsource==1.2.0 ; python_version >= "3.11" and python_version < "4.0"
launchdarkly-server-sdk==9.8.0 ; python_version >= "3.11" and python_version < "4.0"
lazy-model==0.2.0 ; python_version >= "3.11" and python_version < "4.0"
libmagic==1.0 ; python_version >= "3.11" and python_version < "4.0"
limits==3.14.1 ; python_version >= "3.11" and python_version < "4.0"
lxml==5.3.0 ; python_version >= "3.11" and python_version < "4.0"
markdown==3.7 ; python_version >= "3.11" and python_version < "4.0"
marshmallow==3.23.1 ; python_version >= "3.11" and python_version < "4.0"
monotonic==1.6 ; python_version >= "3.11" and python_version < "4.0"
motor==3.6.0 ; python_version >= "3.11" and python_version < "4.0"
msgpack==1.1.0 ; python_version >= "3.11" and python_version < "4.0"
multidict==6.1.0 ; python_version >= "3.11" and python_version < "4.0"
mypy-extensions==1.0.0 ; python_version >= "3.11" and python_version < "4.0"
naked==0.1.32 ; python_version >= "3.11" and python_version < "4.0"
numpy==2.2.0 ; python_version >= "3.11" and python_version < "4.0"
openai==1.58.1 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-api==1.25.0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-distro==0.46b0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-exporter-otlp-proto-common==1.25.0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-exporter-otlp-proto-grpc==1.25.0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-exporter-otlp-proto-http==1.25.0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-exporter-otlp==1.25.0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-instrumentation-asgi==0.46b0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-instrumentation-fastapi==0.46b0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-instrumentation==0.46b0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-proto==1.25.0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-sdk==1.25.0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-semantic-conventions==0.46b0 ; python_version >= "3.11" and python_version < "4.0"
opentelemetry-util-http==0.46b0 ; python_version >= "3.11" and python_version < "4.0"
packaging==24.2 ; python_version >= "3.11" and python_version < "4.0"
pandas==2.2.3 ; python_version >= "3.11" and python_version < "4.0"
pdfminer-six==20231228 ; python_version >= "3.11" and python_version < "4.0"
pdfplumber==0.11.4 ; python_version >= "3.11" and python_version < "4.0"
phonenumbers==8.13.52 ; python_version >= "3.11" and python_version < "4.0"
pillow==11.0.0 ; python_version >= "3.11" and python_version < "4.0"
pluggy==1.5.0 ; python_version >= "3.11" and python_version < "4.0"
posthog==3.7.4 ; python_version >= "3.11" and python_version < "4.0"
propcache==0.2.1 ; python_version >= "3.11" and python_version < "4.0"
proto-plus==1.25.0 ; python_version >= "3.11" and python_version < "4.0"
protobuf==4.25.5 ; python_version >= "3.11" and python_version < "4.0"
pyasn1-modules==0.4.0 ; python_version >= "3.11" and python_version < "4.0"
pyasn1==0.6.1 ; python_version >= "3.11" and python_version < "4.0"
pycountry==24.6.1 ; python_version >= "3.11" and python_version < "4.0"
pycparser==2.22 ; python_version >= "3.11" and python_version < "4.0" and platform_python_implementation != "PyPy"
pycryptodome==3.21.0 ; python_version >= "3.11" and python_version < "4.0"
pydantic-core==2.27.1 ; python_version >= "3.11" and python_version < "4.0"
pydantic-extra-types==2.10.1 ; python_version >= "3.11" and python_version < "4.0"
pydantic==2.10.3 ; python_version >= "3.11" and python_version < "4.0"
pydub==0.25.1 ; python_version >= "3.11" and python_version < "4.0"
pyjwt==2.10.1 ; python_version >= "3.11" and python_version < "4.0"
pyjwt[crypto]==2.10.1 ; python_version >= "3.11" and python_version < "4.0"
pymongo==4.9.2 ; python_version >= "3.11" and python_version < "4.0"
pyparsing==3.2.0 ; python_version >= "3.11" and python_version < "4.0"
pypdfium2==4.30.0 ; python_version >= "3.11" and python_version < "4.0"
pyrfc3339==2.0.1 ; python_version >= "3.11" and python_version < "4.0"
pytesseract==0.3.13 ; python_version >= "3.11" and python_version < "4.0"
pytest-asyncio==0.21.2 ; python_version >= "3.11" and python_version < "4.0"
pytest-env==1.1.3 ; python_version >= "3.11" and python_version < "4.0"
pytest-mock==3.14.0 ; python_version >= "3.11" and python_version < "4.0"
pytest==7.4.4 ; python_version >= "3.11" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.11" and python_version < "4.0"
python-docx==1.1.2 ; python_version >= "3.11" and python_version < "4.0"
python-dotenv==1.0.1 ; python_version >= "3.11" and python_version < "4.0"
python-json-logger==2.0.7 ; python_version >= "3.11" and python_version < "4.0"
python-magic==0.4.27 ; python_version >= "3.11" and python_version < "4.0"
python-multipart==0.0.18 ; python_version >= "3.11" and python_version < "4.0"
pytz==2024.2 ; python_version >= "3.11" and python_version < "4.0"
pyyaml==6.0.2 ; python_version >= "3.11" and python_version < "4.0"
redis[hiredis]==5.2.1 ; python_version >= "3.11" and python_version < "4.0"
regex==2024.11.6 ; python_version >= "3.11" and python_version < "4.0"
requests==2.32.3 ; python_version >= "3.11" and python_version < "4.0"
respx==0.21.1 ; python_version >= "3.11" and python_version < "4.0"
rsa==4.9 ; python_version >= "3.11" and python_version < "4"
s3transfer==0.10.4 ; python_version >= "3.11" and python_version < "4.0"
segment-analytics-python==2.3.3 ; python_version >= "3.11" and python_version < "4.0"
segment==0.2.0 ; python_version >= "3.11" and python_version < "4.0"
semver==3.0.2 ; python_version >= "3.11" and python_version < "4.0"
sentry-sdk[fastapi]==2.19.2 ; python_version >= "3.11" and python_version < "4.0"
setuptools==75.6.0 ; python_version >= "3.11" and python_version < "4.0"
shapely==2.0.6 ; python_version >= "3.11" and python_version < "4.0"
six==1.17.0 ; python_version >= "3.11" and python_version < "4.0"
slack-sdk==3.34.0 ; python_version >= "3.11" and python_version < "4.0"
slowapi==0.1.9 ; python_version >= "3.11" and python_version < "4.0"
sniffio==1.3.1 ; python_version >= "3.11" and python_version < "4.0"
starlette==0.41.3 ; python_version >= "3.11" and python_version < "4.0"
status==0.2.5 ; python_version >= "3.11" and python_version < "4.0"
stripe==10.12.0 ; python_version >= "3.11" and python_version < "4.0"
tabulate==0.9.0 ; python_version >= "3.11" and python_version < "4.0"
tiktoken==0.5.2 ; python_version >= "3.11" and python_version < "4.0"
tokenizers==0.21.0 ; python_version >= "3.11" and python_version < "4.0"
toml==0.10.2 ; python_version >= "3.11" and python_version < "4.0"
tornado==6.4.2 ; python_version >= "3.11" and python_version < "4.0"
tqdm==4.67.1 ; python_version >= "3.11" and python_version < "4.0"
typing-extensions==4.12.2 ; python_version >= "3.11" and python_version < "4.0"
typing-inspect==0.9.0 ; python_version >= "3.11" and python_version < "4.0"
tzdata==2024.2 ; python_version >= "3.11" and python_version < "4.0"
tzlocal==5.2 ; python_version >= "3.11" and python_version < "4.0"
unidecode==1.3.8 ; python_version >= "3.11" and python_version < "4.0"
uritemplate==4.1.1 ; python_version >= "3.11" and python_version < "4.0"
urllib3==2.2.3 ; python_version >= "3.11" and python_version < "4.0"
uvicorn[standard]==0.30.6 ; python_version >= "3.11" and python_version < "4.0"
uvloop==0.21.0 ; (sys_platform != "win32" and sys_platform != "cygwin") and platform_python_implementation != "PyPy" and python_version >= "3.11" and python_version < "4.0"
vertexai==1.71.1 ; python_version >= "3.11" and python_version < "4.0"
watchfiles==1.0.3 ; python_version >= "3.11" and python_version < "4.0"
websockets==13.1 ; python_version >= "3.11" and python_version < "4.0"
wrapt==1.17.0 ; python_version >= "3.11" and python_version < "4.0"
xmltodict==0.14.2 ; python_version >= "3.11" and python_version < "4.0"
yarl==1.18.3 ; python_version >= "3.11" and python_version < "4.0"
zipp==3.21.0 ; python_version >= "3.11" and python_version < "4.0"

Other information

If I attempt to use the deprecated `deepgram.listen.prerecorded.v("1").transcribe_file()` to transcribe, it doesn't create any spikes but it's async version `deepgram.listen.asyncprerecorded.v("1").transcribe_file()` does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant