Spaces:
Runtime error
Runtime error
test
Browse files
app.py
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
-
# import matplotlib.pyplot as plt
|
2 |
import gradio as gr
|
3 |
-
|
4 |
|
5 |
-
|
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 |
-
|
|
|
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"
|