Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmol committed Aug 16, 2023
1 parent 7c09983 commit 724a1cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cog.yaml
Expand Up @@ -18,7 +18,7 @@ build:

# a list of packages in the format <package-name>==<version>
python_packages:
- "faster-whisper==0.7.0"
- "faster-whisper==0.7.1"
- "transformers==4.25.1"
- "accelerate==0.15.0"
- "ffmpeg-python==0.2.0"
Expand Down
5 changes: 2 additions & 3 deletions predict.py
Expand Up @@ -32,7 +32,7 @@ def setup(self):
model_name = "large-v2"
self.model = WhisperModel(
model_name,
device=("cuda" if torch.cuda.is_available() else "cpu"),
device="cuda" if torch.cuda.is_available() else "cpu",
compute_type="float16")
self.embedding_model = PretrainedSpeakerEmbedding(
"speechbrain/spkrec-ecapa-voxceleb",
Expand Down Expand Up @@ -68,7 +68,7 @@ def predict(
raise RuntimeError("Provide either file_string or file_url")
""" filepath = ''
file_start, file_ending = os.path.splitext(f'{filename}')"""
ts = time.time()
ts = time.time_ns()
filename = f'{ts}-recording'
file_extension = '.mp3'

Expand Down Expand Up @@ -148,7 +148,6 @@ def speech_to_text(self,
segments, _ = self.model.transcribe(audio_file_wav, **options)
segments = list(segments)
print("done with whisper")
print(segments)
segments = [{
'start':
int(round(s.start + offset_seconds)),
Expand Down

0 comments on commit 724a1cb

Please sign in to comment.