Skip to content

Commit

Permalink
Refactor build.yaml to use environment variable for simpler-whisper v…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
royshil committed Oct 25, 2024
1 parent c9dd0a4 commit 7950916
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:

runs-on: ${{ matrix.os }}

env:
simpler-whisper-version: 0.2.0

steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -67,8 +70,8 @@ jobs:
- name: Install Linux simpler-whisper
if: matrix.target == 'linux'
run: |
curl -L https://github.com/locaal-ai/simpler-whisper/releases/download/0.1.0/simpler_whisper-0.1.0-cp311-cp311-cpu-x86_64-linux_x86_64.whl -o simpler_whisper-0.1.0-cp311-cp311-linux_x86_64.whl
python -m pip install simpler_whisper-0.1.0-cp311-cp311-linux_x86_64.whl
curl -L https://github.com/locaal-ai/simpler-whisper/releases/download/${{ simpler-whisper-version }}/simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-cpu-x86_64-linux_x86_64.whl -o simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-linux_x86_64.whl
python -m pip install simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-linux_x86_64.whl
- name: Install MacOS llama-cpp-python
if: startsWith(matrix.os, 'macos')
Expand All @@ -78,31 +81,31 @@ jobs:
- name: Install MacOS arm64 simpler-whisper
if: matrix.target == 'macos-arm64'
run: |
curl -L https://github.com/locaal-ai/simpler-whisper/releases/download/0.1.0/simpler_whisper-0.1.0-cp311-cp311-cpu-arm64-macosx_14_0_universal2.whl -o simpler_whisper-0.1.0-cp311-cp311-macosx_14_0_universal2.whl
python -m pip install simpler_whisper-0.1.0-cp311-cp311-macosx_14_0_universal2.whl
curl -L https://github.com/locaal-ai/simpler-whisper/releases/download/${{ simpler-whisper-version }}/simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-cpu-arm64-macosx_14_0_universal2.whl -o simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-macosx_14_0_universal2.whl
python -m pip install simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-macosx_14_0_universal2.whl
- name: Install MacOS x86_64 simpler-whisper
if: matrix.target == 'macos-x86'
run: |
curl -L https://github.com/locaal-ai/simpler-whisper/releases/download/0.1.0/simpler_whisper-0.1.0-cp311-cp311-cpu-x86_64-macosx_14_0_universal2.whl -o simpler_whisper-0.1.0-cp311-cp311-macosx_14_0_universal2.whl
python -m pip install simpler_whisper-0.1.0-cp311-cp311-macosx_14_0_universal2.whl
curl -L https://github.com/locaal-ai/simpler-whisper/releases/download/${{ simpler-whisper-version }}/simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-cpu-x86_64-macosx_14_0_universal2.whl -o simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-macosx_14_0_universal2.whl
python -m pip install simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-macosx_14_0_universal2.whl
- name: Install Windows CPU dependencies
if: matrix.target == 'windows-cpu'
run: |
Invoke-WebRequest -Uri https://github.com/abetlen/llama-cpp-python/releases/download/v0.3.1/llama_cpp_python-0.3.1-cp311-cp311-win_amd64.whl -OutFile llama_cpp_python-0.3.1-cp311-cp311-win_amd64.whl
python -m pip install llama_cpp_python-0.3.1-cp311-cp311-win_amd64.whl
Invoke-WebRequest -Uri https://github.com/locaal-ai/simpler-whisper/releases/download/0.1.0/simpler_whisper-0.1.0-cp311-cp311-cpu-win64-win_amd64.whl -OutFile simpler_whisper-0.1.0-cp311-cp311-win_amd64.whl
python -m pip install simpler_whisper-0.1.0-cp311-cp311-win_amd64.whl
Invoke-WebRequest -Uri https://github.com/locaal-ai/simpler-whisper/releases/download/${{ simpler-whisper-version }}/simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-cpu-win64-win_amd64.whl -OutFile simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-win_amd64.whl
python -m pip install simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-win_amd64.whl
- name: Install Windows CUDA dependencies
if: matrix.target == 'windows-cuda'
run: |
python -m pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu125
Invoke-WebRequest -Uri https://github.com/locaal-ai/simpler-whisper/releases/download/0.1.0/simpler_whisper-0.1.0-cp311-cp311-cuda-win64-win_amd64.whl -OutFile simpler_whisper-0.1.0-cp311-cp311-win_amd64.whl
python -m pip install simpler_whisper-0.1.0-cp311-cp311-win_amd64.whl
Invoke-WebRequest -Uri https://github.com/locaal-ai/simpler-whisper/releases/download/${{ simpler-whisper-version }}/simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-cuda-win64-win_amd64.whl -OutFile simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-win_amd64.whl
python -m pip install simpler_whisper-${{ simpler-whisper-version }}-cp311-cp311-win_amd64.whl
- name: Install dependencies
run: |
Expand Down
5 changes: 5 additions & 0 deletions src/audio/textual_transcription_textarea.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
from audio.Transcriber import Transcriber
from audio.AudioCapture import AudioCapture
from notes.manager import NoteManager
from simpler_whisper.whisper import set_log_callback, LogLevel

def my_log_callback(level, message):
# prevent debug messages from being printed
pass

class TranscriptionTextArea(TextArea):
def __init__(self, *args, **kwargs):
Expand All @@ -22,6 +26,7 @@ def __init__(self, *args, **kwargs):
self.update_queue = Queue()
self.is_transcribing = False
self.wav_file = None
set_log_callback(my_log_callback)
self.transcriber = Transcriber()
self.audio_capture = None
self.read_only = True
Expand Down

0 comments on commit 7950916

Please sign in to comment.