generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Hey, running the python SDK I get 100% cpu usage without fail. Am I doing something wrong? This doesn't allow me to use this client.
import amazon_transcribe
amazon_transcribe.__version__
# '0.6.2'
from amazon_transcribe.client import TranscribeStreamingClient
import threading
import asyncio
async def _transcribe_main(region):
client = TranscribeStreamingClient(region=region)
stream = await client.start_stream_transcription(
language_code="en-US",
media_sample_rate_hz=8000,
media_encoding="pcm",
show_speaker_label=False,
vocabulary_name=None,
enable_partial_results_stabilization=True,
partial_results_stability="high",
)
def _run_async():
asyncio.run(_transcribe_main("us-east-1"))
thread = threading.Thread(target=_run_async, daemon=True)
thread.start()
import psutil
def monitor_cpu():
while True:
cpu_usage = psutil.Process().cpu_percent(interval=0.2)
print(f"Current Process CPU Usage: {cpu_usage}%",end="\r")
cpu_thread = threading.Thread(target=monitor_cpu, daemon=True)
cpu_thread.start()
# Current Process CPU Usage: 99.2%%Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels