Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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)
|