Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -107,27 +107,27 @@ def paraphrase(sentence: str, count: str):
|
|
107 |
# print(res)
|
108 |
|
109 |
#
|
110 |
-
input_ids, attention_masks = encoding["input_ids"], encoding["attention_mask"]
|
111 |
-
outputs = model.generate(input_ids=input_ids,
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
result_v4 = []
|
120 |
-
for output in outputs:
|
121 |
-
|
122 |
-
|
123 |
#
|
124 |
|
125 |
return {
|
126 |
'result': {
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
'generate_v4':
|
131 |
}
|
132 |
}
|
133 |
|
|
|
107 |
# print(res)
|
108 |
|
109 |
#
|
110 |
+
# input_ids, attention_masks = encoding["input_ids"], encoding["attention_mask"]
|
111 |
+
# outputs = model.generate(input_ids=input_ids,
|
112 |
+
# attention_mask=attention_masks,
|
113 |
+
# max_length=512,
|
114 |
+
# do_sample=True,
|
115 |
+
# top_k=120,
|
116 |
+
# top_p=0.95,
|
117 |
+
# early_stopping=True,
|
118 |
+
# num_return_sequences=p_count)
|
119 |
+
# result_v4 = []
|
120 |
+
# for output in outputs:
|
121 |
+
# line = tokenizer.decode(output, skip_special_tokens=True, clean_up_tokenization_spaces=True)
|
122 |
+
# result_v4.append(line)
|
123 |
#
|
124 |
|
125 |
return {
|
126 |
'result': {
|
127 |
+
'generate_v1':generate_v1(encoding, p_count),
|
128 |
+
'generate_v2':generate_v2(encoding, p_count),
|
129 |
+
'generate_v3':generate_v3(encoding, p_count),
|
130 |
+
'generate_v4':generate_v4(encoding, p_count)
|
131 |
}
|
132 |
}
|
133 |
|