Dominik Macháček 2024-11-15
lru_cache didn't work with Python 3.6.9, openai api needs py version
@fb32dcb7c3db748d55eba8c8d537e43fe57e5260
README.md
--- README.md
+++ README.md
@@ -43,7 +43,7 @@
 Alternative, less restrictive, but slower backend is [whisper-timestamped](https://github.com/linto-ai/whisper-timestamped): `pip install git+https://github.com/linto-ai/whisper-timestamped`
 
 Thirdly, it's also possible to run this software from the [OpenAI Whisper API](https://platform.openai.com/docs/api-reference/audio/createTranscription). This solution is fast and requires no GPU, just a small VM will suffice, but you will need to pay OpenAI for api access. Also note that, since each audio fragment is processed multiple times, the [price](https://openai.com/pricing) will be higher than obvious from the pricing page, so keep an eye on costs while using. Setting a higher chunk-size will reduce costs significantly. 
-Install with: `pip install openai`
+Install with: `pip install openai` , [requires Python >=3.8](https://pypi.org/project/openai/).
 
 For running with the openai-api backend, make sure that your [OpenAI api key](https://platform.openai.com/api-keys) is set in the `OPENAI_API_KEY` environment variable. For example, before running, do: `export OPENAI_API_KEY=sk-xxx` with *sk-xxx* replaced with your api key. 
 
whisper_online.py
--- whisper_online.py
+++ whisper_online.py
@@ -12,7 +12,7 @@
 
 logger = logging.getLogger(__name__)
 
-@lru_cache
+@lru_cache(10**6)
 def load_audio(fname):
     a, _ = librosa.load(fname, sr=16000, dtype=np.float32)
     return a
Add a comment
List