Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,22 +29,23 @@ if submit:
|
|
| 29 |
do_sample=True,
|
| 30 |
max_length=50,
|
| 31 |
top_p=0.99,
|
| 32 |
-
top_k=
|
| 33 |
-
num_return_sequences=
|
| 34 |
)
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
| 29 |
do_sample=True,
|
| 30 |
max_length=50,
|
| 31 |
top_p=0.99,
|
| 32 |
+
top_k=50,
|
| 33 |
+
num_return_sequences=3
|
| 34 |
)
|
| 35 |
|
| 36 |
+
for x in outputs:
|
| 37 |
+
st.subheader("Most probable: ")
|
| 38 |
+
|
| 39 |
+
out_text = ttokenizer.decode(x, skip_special_tokens=True)
|
| 40 |
+
st.success(out_text.capitalize())
|
| 41 |
+
|
| 42 |
+
st.markdown("### Edited sentences:")
|
| 43 |
+
c_text = ""
|
| 44 |
+
for x in out_text.lower().split(" "):
|
| 45 |
+
if x in input_text.lower().split(" "):
|
| 46 |
+
c_text = c_text + x + " "
|
| 47 |
+
else:
|
| 48 |
+
c_text = c_text + '<span style="font-weight:bold; color:rgb(150,255,100);">' + x + '</span>' + " "
|
| 49 |
+
|
| 50 |
+
ct = c_text.capitalize()
|
| 51 |
+
st.markdown(str(ct), unsafe_allow_html=True)
|