Remove download_simulstreaming_backend
This commit is contained in:
parent
bda72b8bc0
commit
ba41c4ab56
2 changed files with 0 additions and 33 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
from .download_simulstreaming_backend import download_simulstreaming_backend
|
|
||||||
from .audio_processor import AudioProcessor
|
from .audio_processor import AudioProcessor
|
||||||
from .core import TranscriptionEngine
|
from .core import TranscriptionEngine
|
||||||
from .parse_args import parse_args
|
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.")
|
|
||||||
Loading…
Reference in a new issue