dash-asg / app.py
wasmdashai's picture
Update app.py
7c2d1cf verified
raw
history blame
781 Bytes
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",
)
def greet(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)
demo = gr.Interface(fn=greet, inputs=["text",model_choices], outputs="text")
demo.launch()