Skip to content

Commit

Permalink
test links
Browse files Browse the repository at this point in the history
  • Loading branch information
Bebra777228 committed Sep 5, 2024
1 parent 447f8af commit 41bd6bf
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/test_links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Check Links

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
check-links:
runs-on: ubuntu-latest

steps:
- name: Проверка кода
uses: actions/checkout@v4

- name: Настройка Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Установка зависимостей
run: |
pip install --upgrade pip==23.1
pip install requests gdown gradio
- name: Google Drive
run: |
python rvc/modules/model_management.py "https://drive.google.com/file/d/1lVQuCq5sQXRnAb_Z6m0nKb9305aePowy/view?usp=sharing" "test_model"
- name: HuggingFace
run: |
python rvc/modules/model_management.py "https://huggingface.co/Politrees/Victor_Tsoi/resolve/main/Victor_Tsoi.zip?download=true" "test_model"
# - name: Pixeldrain
# run: |
# python rvc/modules/model_management.py "" "test_model"

# - name: Mega
# run: |
# python rvc/modules/model_management.py "" "test_model"

# - name: Яндекс Диск
# run: |
# python rvc/modules/model_management.py "" "test_model"

# - name: OneDrive
# run: |
# python rvc/modules/model_management.py "" "test_model"

- name: Dropbox
run: |
python rvc/modules/model_management.py "https://www.dropbox.com/scl/fi/qgwb61xk365uoaled6s7b/Model.zip?rlkey=lljqcjqn8appak3jns5b6rc1r&st=tgyolk2w&dl=0" "test_model"
- name: Box
run: |
python rvc/modules/model_management.py "https://app.box.com/s/gh08lk2wtmy893hz1n06uhl8jr7n29sg" "test_model"
- name: MediaFire
run: |
python rvc/modules/model_management.py "https://www.mediafire.com/file/0cjw4ho9m2ap7z0/Model.zip/file" "test_model"
- name: pCloud
run: |
python rvc/modules/model_management.py "https://e.pcloud.link/publink/show?code=XZTUsPZmjRlLDvPbAfEP7t4fvSHPYID49PV" "test_model"
21 changes: 21 additions & 0 deletions rvc/modules/model_management.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import sys
import shutil
import urllib.request
import zipfile
Expand Down Expand Up @@ -210,3 +211,23 @@ def upload_separate_files(pth_file, index_file, dir_name, progress=gr.Progress()
return f"[+] Модель {dir_name} успешно загружена!"
except Exception as e:
raise gr.Error(str(e))


# Функция для вызова из командной строки
def main():
if len(sys.argv) != 3:
print("Использование: python model_management.py <url> <dir_name>")
sys.exit(1)

url = sys.argv[1]
dir_name = sys.argv[2]

try:
result = download_from_url(url, dir_name)
print(result)
except gr.Error as e:
print(f"Error: {str(e)}")
sys.exit(1)

if __name__ == "__main__":
main()

0 comments on commit 41bd6bf

Please sign in to comment.