jm12138 commited on
Commit
5d16acd
1 Parent(s): e41a8b4
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,8 +1,7 @@
1
- # import matplotlib.pyplot as plt
2
  import gradio as gr
3
- # import paddlehub as hub
4
 
5
- # ernie_zeus = hub.Module(name='ernie_zeus')
6
 
7
 
8
  def inference(task: str,
@@ -11,7 +10,8 @@ def inference(task: str,
11
  seq_len: int = 512,
12
  topp: float = 0.9,
13
  penalty_score: float = 1.0):
14
- return "success"
 
15
 
16
 
17
  title = "ERNIE-Zeus"
 
 
1
  import gradio as gr
2
+ import paddlehub as hub
3
 
4
+ ernie_zeus = hub.Module(name='ernie_zeus')
5
 
6
 
7
  def inference(task: str,
 
10
  seq_len: int = 512,
11
  topp: float = 0.9,
12
  penalty_score: float = 1.0):
13
+ func = getattr(ernie_zeus, task)
14
+ return func(text, min_dec_len, seq_len, topp, penalty_score)
15
 
16
 
17
  title = "ERNIE-Zeus"