Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,306 Bytes
d010b15 3283950 db455db 5bca4fe db455db 5bca4fe 7634e1f 5bca4fe 7634e1f 5bca4fe 3283950 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
from sonique import get_pretrained_model
from sonique.interface.gradio import create_ui
import json
from huggingface_hub import login
import torch
import os
login(token=os.getenv('HF_TOKEN'))
interface = create_ui(
model_config_path = str(cached_path('https://raw.githubusercontent.com/zxxwxyyy/sonique/refs/heads/main/best_model.json')),
ckpt_path=str(cached_path('hf://mrfakename/SONIQUE/stable_ep=220.ckpt')),
# pretrained_name=args.pretrained_name,
pretransform_ckpt_path=None
)
interface.queue().launch()
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description='Run gradio interface')
parser.add_argument('--pretrained-name', type=str, help='Name of pretrained model', required=False)
parser.add_argument('--model-config', type=str, help='Path to model config', required=False)
parser.add_argument('--ckpt-path', type=str, help='Path to model checkpoint', required=False)
parser.add_argument('--pretransform-ckpt-path', type=str, help='Optional to model pretransform checkpoint', required=False)
parser.add_argument('--username', type=str, help='Gradio username', required=False)
parser.add_argument('--password', type=str, help='Gradio password', required=False)
args = parser.parse_args()
main(args) |