mirror of
https://github.com/QuentinFuxa/WhisperLiveKit.git
synced 2026-03-07 22:33:36 +00:00
Remove download_simulstreaming_backend
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
from .download_simulstreaming_backend import download_simulstreaming_backend
|
||||
from .audio_processor import AudioProcessor
|
||||
from .core import TranscriptionEngine
|
||||
from .parse_args import parse_args
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import os
|
||||
import requests
|
||||
import inspect
|
||||
|
||||
def get_module_path():
|
||||
return os.path.dirname(inspect.getfile(inspect.currentframe()))
|
||||
|
||||
GITHUB_API_URL = "https://api.github.com/repos/ufal/SimulStreaming/contents/simul_whisper/whisper"
|
||||
RAW_BASE_URL = "https://raw.githubusercontent.com/ufal/SimulStreaming/main/simul_whisper/whisper"
|
||||
TARGET_DIR = os.path.join(get_module_path(), "simul_whisper", "whisper")
|
||||
|
||||
def download_files_from_github(api_url, local_dir):
|
||||
os.makedirs(local_dir, exist_ok=True)
|
||||
response = requests.get(api_url)
|
||||
response.raise_for_status()
|
||||
items = response.json()
|
||||
for item in items:
|
||||
if item['type'] == 'file':
|
||||
download_url = item['download_url']
|
||||
file_name = item['name']
|
||||
file_response = requests.get(download_url)
|
||||
file_response.raise_for_status()
|
||||
with open(os.path.join(local_dir, file_name), 'wb') as f:
|
||||
f.write(file_response.content)
|
||||
elif item['type'] == 'dir':
|
||||
# Recursive call for subdirectories
|
||||
download_files_from_github(item['url'], os.path.join(local_dir, item['name']))
|
||||
|
||||
def download_simulstreaming_backend():
|
||||
print(f"Downloading files into {TARGET_DIR} ...")
|
||||
download_files_from_github(GITHUB_API_URL, TARGET_DIR)
|
||||
print("✅ Download of SimulStreaming backend files completed successfully.")
|
||||
Reference in New Issue
Block a user