vishnun commited on
Commit
7945e1e
1 Parent(s): 3d5e42b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -17
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=70,
33
- num_return_sequences=1
34
  )
35
 
36
- st.subheader("Suggested sentence: ")
37
-
38
- out_text = ttokenizer.decode(outputs[0], skip_special_tokens=True)
39
- st.success(out_text.capitalize())
40
-
41
- st.markdown("### Edited sentence:")
42
- c_text = ""
43
- for x in out_text.lower().split(" "):
44
- if x in input_text.lower().split(" "):
45
- c_text = c_text + x + " "
46
- else:
47
- c_text = c_text + '<span style="font-weight:bold; color:rgb(150,255,100);">' + x + '</span>' + " "
48
-
49
- ct = c_text.capitalize()
50
- st.markdown(str(ct), unsafe_allow_html=True)
 
 
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)