satpalsr commited on
Commit
d2e71f1
1 Parent(s): a1bbb1a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from happytransformer import HappyTextToText, TTSettings
3
+
4
+ happy_tt = HappyTextToText("T5", "team-writing-assistant/t5-base-c4jfleg")
5
+ args = TTSettings(num_beams=5, min_length=1)
6
+
7
+ input = st.text_area('Enter some text')
8
+
9
+ if input:
10
+ input = "grammar: " + input
11
+ result = happy_tt.generate_text(input, args=args)
12
+ st.text(result.text)