solve #100
This commit is contained in:
parent
ccf99cecdf
commit
e9022894b2
4 changed files with 18 additions and 6 deletions
|
|
@ -72,6 +72,12 @@ pip install tokenize_uk # If you work with Ukrainian text
|
||||||
|
|
||||||
# If you want to use diarization
|
# If you want to use diarization
|
||||||
pip install diart
|
pip install diart
|
||||||
|
|
||||||
|
# Optional backends. Default is faster-whisper
|
||||||
|
pip install whisperlivekit[whisper] # Original Whisper backend
|
||||||
|
pip install whisperlivekit[whisper-timestamped] # Whisper with improved timestamps
|
||||||
|
pip install whisperlivekit[mlx-whisper] # Optimized for Apple Silicon
|
||||||
|
pip install whisperlivekit[openai] # OpenAI API backend
|
||||||
```
|
```
|
||||||
|
|
||||||
### Get access to 🎹 pyannote models
|
### Get access to 🎹 pyannote models
|
||||||
|
|
|
||||||
7
setup.py
7
setup.py
|
|
@ -1,8 +1,7 @@
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="whisperlivekit",
|
name="whisperlivekit",
|
||||||
version="0.1.2",
|
version="0.1.3",
|
||||||
description="Real-time, Fully Local Whisper's Speech-to-Text and Speaker Diarization",
|
description="Real-time, Fully Local Whisper's Speech-to-Text and Speaker Diarization",
|
||||||
long_description=open("README.md", "r", encoding="utf-8").read(),
|
long_description=open("README.md", "r", encoding="utf-8").read(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|
@ -22,6 +21,10 @@ setup(
|
||||||
"diarization": ["diart"],
|
"diarization": ["diart"],
|
||||||
"vac": ["torch"],
|
"vac": ["torch"],
|
||||||
"sentence": ["mosestokenizer", "wtpsplit"],
|
"sentence": ["mosestokenizer", "wtpsplit"],
|
||||||
|
"whisper": ["whisper"],
|
||||||
|
"whisper-timestamped": ["whisper-timestamped"],
|
||||||
|
"mlx-whisper": ["mlx-whisper"],
|
||||||
|
"openai": ["openai"],
|
||||||
},
|
},
|
||||||
package_data={
|
package_data={
|
||||||
'whisperlivekit': ['web/*.html'],
|
'whisperlivekit': ['web/*.html'],
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
try:
|
try:
|
||||||
from whisperlivekit.whisper_streaming_custom.whisper_online import backend_factory, warmup_asr
|
from whisperlivekit.whisper_streaming_custom.whisper_online import backend_factory, warmup_asr
|
||||||
except:
|
except ImportError:
|
||||||
from whisper_streaming_custom.whisper_online import backend_factory, warmup_asr
|
from .whisper_streaming_custom.whisper_online import backend_factory, warmup_asr
|
||||||
from argparse import Namespace, ArgumentParser
|
from argparse import Namespace, ArgumentParser
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,10 @@ import logging
|
||||||
import io
|
import io
|
||||||
import soundfile as sf
|
import soundfile as sf
|
||||||
import math
|
import math
|
||||||
import torch
|
try:
|
||||||
|
import torch
|
||||||
|
except ImportError:
|
||||||
|
torch = None
|
||||||
from typing import List
|
from typing import List
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from whisperlivekit.timed_objects import ASRToken
|
from whisperlivekit.timed_objects import ASRToken
|
||||||
|
|
@ -102,7 +105,7 @@ class FasterWhisperASR(ASRBase):
|
||||||
model_size_or_path = modelsize
|
model_size_or_path = modelsize
|
||||||
else:
|
else:
|
||||||
raise ValueError("Either modelsize or model_dir must be set")
|
raise ValueError("Either modelsize or model_dir must be set")
|
||||||
device = "cuda" if torch.cuda.is_available() else "cpu"
|
device = "cuda" if torch and torch.cuda.is_available() else "cpu"
|
||||||
compute_type = "float16" if device == "cuda" else "float32"
|
compute_type = "float16" if device == "cuda" else "float32"
|
||||||
|
|
||||||
model = WhisperModel(
|
model = WhisperModel(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue