Spaces:
Runtime error
Runtime error
Commit
·
a05576a
1
Parent(s):
3a9c256
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,12 +32,7 @@ def paraphrase(
|
|
| 32 |
)
|
| 33 |
|
| 34 |
res = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 35 |
-
|
| 36 |
-
result = ''
|
| 37 |
-
for i, item in enumerate(res):
|
| 38 |
-
result += f'{i+1}. {item}\n'
|
| 39 |
-
|
| 40 |
-
return result
|
| 41 |
|
| 42 |
def fn(
|
| 43 |
text,
|
|
@@ -50,7 +45,11 @@ def fn(
|
|
| 50 |
temperature=0.7,
|
| 51 |
max_length=128
|
| 52 |
):
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
demo = gr.Interface(
|
| 56 |
fn=fn,
|
|
|
|
| 32 |
)
|
| 33 |
|
| 34 |
res = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 35 |
+
return res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
def fn(
|
| 38 |
text,
|
|
|
|
| 45 |
temperature=0.7,
|
| 46 |
max_length=128
|
| 47 |
):
|
| 48 |
+
res = paraphrase(text, num_beams, num_beam_groups, num_return_sequences, repetition_penalty, diversity_penalty, no_repeat_ngram_size, temperature, max_length)
|
| 49 |
+
result = ''
|
| 50 |
+
for i, item in enumerate(res):
|
| 51 |
+
result += f'{i+1}. {item}\n'
|
| 52 |
+
return result
|
| 53 |
|
| 54 |
demo = gr.Interface(
|
| 55 |
fn=fn,
|