import gradio as gr import torch from model import Model, ModelType from app_pose import create_demo as create_demo_pose import argparse import os on_huggingspace = os.environ.get("SPACE_AUTHOR_NAME") == "PAIR" model = Model(device='cuda', dtype=torch.float16) parser = argparse.ArgumentParser() parser.add_argument('--public_access', action='store_true', help="if enabled, the app can be access from a public url", default=False) args = parser.parse_args() with gr.Blocks(css='style.css') as demo: with gr.Tab('Pose Conditional'): create_demo_pose(model) ''' ''' if on_huggingspace: demo.queue(max_size=20) demo.launch(debug=True) else: _, _, link = demo.queue(api_open=False).launch( file_directories=['temporal'], share=args.public_access) print(link)