wasmdashai commited on
Commit
b8284a1
·
verified ·
1 Parent(s): a5cf614

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -3
app.py CHANGED
@@ -5,10 +5,30 @@ sys.path.insert(0, "ASG.API/")
5
  from ASGModels import ASG
6
 
7
  ASGAI=ASG(isForm=False)
 
 
 
 
 
 
 
 
 
 
8
 
9
- def greet(name):
10
- out=ASGAI.Group.Predict_ALL(name)
 
 
 
 
 
 
 
 
 
 
11
  return str(out)
12
 
13
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
14
  demo.launch()
 
5
  from ASGModels import ASG
6
 
7
  ASGAI=ASG(isForm=False)
8
+ choices=[
9
+ "Group",
10
+ "Technique",
11
+ "Software"
12
+ ]
13
+ model_choices = gr.Dropdown(
14
+ choices=choices,
15
+ label="اختر النموذج",
16
+ value="Group",
17
+ )
18
 
19
+
20
+
21
+ def greet(text,namn_model):
22
+ if namn_model=="Group":
23
+ out=ASGAI.Group.Predict_ALL(text)
24
+ elif namn_model=="Technique":
25
+ out=ASGAI.Technique.Predict_ALL(text)
26
+ else:
27
+ out=ASGAI.Soft.Predict_ALL(text)
28
+
29
+
30
+
31
  return str(out)
32
 
33
+ demo = gr.Interface(fn=greet, inputs=["text",model_choices], outputs="text")
34
  demo.launch()