import gradio as gr import sys sys.path.insert(0, "ASG.API/") from ASGModels import ASG ASGAI=ASG(isForm=False) choices=[ "Group", "Technique", "Software" ] model_choices = gr.Dropdown( choices=choices, label="اختر النموذج", value="Group", ) import gradio as gr def home_page(): return """

مرحباً بك في Model AI ASG

Wasm-Speeker We provide models that help to aid in the creation of different attack sequences. You can deal with AGS models by choosing the model you want. We provide models that help to aid in the creation of different attack sequences. You can deal with AGS models by choosing the model you want.

Bootstrap Themes

Responsive left-aligned hero with image

Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.

Border hero with cropped image and shadows

Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.

Dark mode hero

Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.

""" def t2t(text, namn_model): if namn_model == "Group": out = ASGAI.Group.predictAPI(text) elif namn_model == "Technique": out = ASGAI.Tec.predictAPI(text) else: out = ASGAI.Soft.predictAPI(text) return str(out) def t2seq(text, namn_model): if namn_model == "Group": out = ASGAI.Group.Predict_ALL(text) elif namn_model == "Technique": out = ASGAI.Tec.Predict_ALL(text) else: out = ASGAI.Soft.Predict_ALL(text) return str(out) def echo(message, history): text=t2seq(message,"Group") return text # Use Blocks with gr.Blocks() as demo: gr.HTML(""" Model AI ASG """) # العنوان الرئيسي gr.Markdown("# Model AI ASG") # عرض الصورة الترحيبية gr.Image("icon (1).jpg", label="Model AI ASG") gr.HTML(""" """) with gr.Row(): with gr.Tab("Home"): gr.HTML(home_page()) with gr.Tab("Thread Base"): gr.Markdown("### Thread Base") with gr.Row(): with gr.Tab("T2T"): text_input = gr.Textbox(label="Input Text") model_choices = gr.Dropdown(choices=["Group", "Technique", "Soft"], label="Model",value="Group",) text_output = gr.Textbox(label="Output") submit_btn = gr.Button("Submit") submit_btn.click(fn=t2t, inputs=[text_input, model_choices], outputs=text_output) with gr.Tab("T2Seq"): text_input_seq = gr.Textbox(label="Input Text") model_choices_seq = gr.Dropdown(choices=["Group", "Technique", "Soft"], label="Model",value="Group",) text_output_seq = gr.Textbox(label="Output") submit_btn_seq = gr.Button("Submit") submit_btn_seq.click(fn=t2seq, inputs=[text_input_seq, model_choices_seq], outputs=text_output_seq) with gr.Tab("T2Sinaro"): model_choices_seq1 = gr.Dropdown(choices=["Group", "Technique", "Soft"], label="Model",value="Group",) gr.ChatInterface(fn=echo, examples=["hello", "hola", "merhaba"], title="Echo Bot") with gr.Tab("Stute Base"): gr.Markdown("### Stute Base") demo.launch() # demo.launch()