====== Speech to Text ====== OpenAI Whisper https://github.com/openai/whisper https://hub.docker.com/r/fedirz/faster-whisper-server https://github.com/speaches-ai/speaches OpenAI/Whisper example python script with changed base url mkdir transcribe cd transcribe python -m venv venv source venv/bin/activate pip install openai cat >> trans.py << EOD #!/home/user/transcribe/venv/bin/python3 from openai import OpenAI import sys,os def usage(): print("Usage: "+os.path.basename(__file__)+" inputfile [outputfile]") print(" inputfile \t\tInput file to transcribe") print(" outputfile\tOptional: Filename to store transcription to") exit(1) try: inputfile = sys.argv[1] except Exception as e: usage() client = OpenAI(base_url="http://192.168.xx.xx:8010/v1", api_key="not needed") audio_file= open(inputfile, "rb") transcription = client.audio.transcriptions.create( model="Systran/faster-whisper-large-v3", file=audio_file ) try: outputfile = sys.argv[2] with open(sys.argv[2], "w") as text_file: text_file.write(transcription.text) except: print(transcription.text) EOD