Skip to content

Commit

Permalink
Add ffmpeg-python as dep
Browse files Browse the repository at this point in the history
  • Loading branch information
vietanhdev committed Oct 6, 2024
1 parent ffa3dd4 commit 351b5fe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions llama_assistant/speech_recognition_thread.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path
import time
import os
import re
import traceback

from PyQt5.QtCore import QThread, pyqtSignal
import pyaudio
Expand Down Expand Up @@ -71,7 +71,6 @@ def run(self):
# Transcribe audio
res = self.whisper.transcribe(str(tmp_filepath))
transcription = self.whisper.extract_text(res)
os.remove(tmp_filepath)

if isinstance(transcription, list):
# Remove all "[BLANK_AUDIO]" from the transcription
Expand All @@ -82,7 +81,10 @@ def run(self):
if transcription.strip(): # Only emit if there's non-empty transcription
self.finished.emit(transcription)

os.remove(tmp_filepath)

except Exception as e:
traceback.print_exc()
self.error.emit(f"An error occurred: {str(e)}")
finally:
stream.stop_stream()
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "llama-assistant"
version = "0.1.33"
version = "0.1.35"
authors = [
{name = "Viet-Anh Nguyen", email = "[email protected]"},
]
Expand All @@ -25,6 +25,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
dependencies = [
"ffmpeg-python",
"PyQt5",
"markdown",
"llama-cpp-python",
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ llama-cpp-python==0.3.1
huggingface_hub==0.25.1
openwakeword==0.6.0
pyinstaller==6.10.0
ffmpeg-python==0.2.0
git+https://github.com/stlukey/whispercpp.py

0 comments on commit 351b5fe

Please sign in to comment.