Spaces:
Running
on
Zero
Running
on
Zero
File size: 822 Bytes
2e7c76e fc9d64f da2f55c fc9d64f da2f55c 7c6f5fb 2e7c76e 7c6f5fb fc9d64f da2f55c |
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 |
import os
import gradio as gr
from app.gui import get_inputs_components, get_outputs_components, get_examples, get_desc
from app.handler import handler
def entry():
REPO_ROOT = str(os.path.join(os.path.dirname(__file__), '..'))
os.system(f'touch {REPO_ROOT}/server_up')
os.system('lsof -i :7860 | grep LISTEN | awk \'{print $2}\' | xargs kill')
try:
demo = gr.Interface(
fn = handler,
inputs = get_inputs_components(),
outputs = get_outputs_components(),
examples = get_examples(),
description = get_desc(),
)
demo.launch()
except Exception as e:
print(f'Error: {str(e)}')
os.system(f'rm {REPO_ROOT}/server_up')
if __name__ == '__main__':
entry() |