File size: 1,344 Bytes
5f685fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr

from gui.ui_tab_short_automation import ShortAutomationUI
from gui.ui_tab_video_automation import VideoAutomationUI
from gui.ui_tab_video_translation import VideoTranslationUI


class GradioContentAutomationUI:
    def __init__(self, shortGPTUI):
        self.shortGPTUI = shortGPTUI
        self.content_automation_ui = None

    def create_ui(self):
        '''Create Gradio interface'''
        with gr.Tab("Content Automation") as self.content_automation_ui:
            gr.Markdown("# ๐Ÿ† Content Automation ๐Ÿš€")
            gr.Markdown("## Choose your desired automation task.")
            choice = gr.Radio(['๐ŸŽฌ Automate the creation of shorts', '๐ŸŽž๏ธ Automate a video with stock assets', '๐ŸŒ Automate multilingual video dubbing'], label="Choose an option")
            video_automation_ui = VideoAutomationUI(self.shortGPTUI).create_ui()
            short_automation_ui = ShortAutomationUI(self.shortGPTUI).create_ui()
            video_translation_ui = VideoTranslationUI(self.shortGPTUI).create_ui()
            choice.change(lambda x: (gr.update(visible=x == choice.choices[1]), gr.update(visible=x == choice.choices[0]), gr.update(
                visible=x == choice.choices[2])), [choice], [video_automation_ui, short_automation_ui, video_translation_ui])
        return self.content_automation_ui