Spaces:
Build error
Build error
File size: 1,396 Bytes
b293d47 8c521a6 b293d47 dab42ce b293d47 |
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 33 34 35 36 37 38 39 |
import gradio as gr
from gui.content_automation_ui import GradioContentAutomationUI
from gui.ui_abstract_base import AbstractBaseUI
from gui.ui_components_html import GradioComponentsHTML
from gui.ui_tab_asset_library import AssetLibrary
from gui.ui_tab_config import ConfigUI
from shortGPT.utils.cli import CLI
class ShortGptUI(AbstractBaseUI):
'''Class for the GUI. This class is responsible for creating the UI and launching the server.'''
def __init__(self, colab=True):
super().__init__(ui_name='gradio_shortgpt')
self.colab = colab
CLI.display_header()
def create_interface(self):
'''Create Gradio interface'''
with gr.Blocks(css="footer {visibility: hidden}", title="ShortGPT Demo") as shortGptUI:
with gr.Row(variant='compact'):
gr.HTML(GradioComponentsHTML.get_html_header())
self.content_automation = GradioContentAutomationUI(shortGptUI).create_ui()
self.asset_library_ui = AssetLibrary().create_ui()
self.config_ui = ConfigUI().create_ui()
return shortGptUI
def launch(self):
'''Launch the server'''
shortGptUI = self.create_interface()
shortGptUI.queue(max_size=20).launch(server_port=31415, height=1000, share=True, server_name="0.0.0.0", max_threads=5)
if __name__ == "__main__":
app = ShortGptUI()
app.launch()
|