Spaces:
Runtime error
Runtime error
Commit
·
ffe85b2
1
Parent(s):
17ee95a
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ model = load_model()
|
|
| 17 |
|
| 18 |
#prompts
|
| 19 |
st.title("Writing Assistant for you 🦄")
|
| 20 |
-
image = Image.open('
|
| 21 |
st.image(image, caption='Sunrise by the mountains')
|
| 22 |
st.subheader("Some examples: ")
|
| 23 |
example_1 = st.button("I am write on AI")
|
|
@@ -28,6 +28,7 @@ textbox = st.text_area('Write your text in this box:', '', height=100, max_chars
|
|
| 28 |
button = st.button('Detect grammar mistakes:')
|
| 29 |
|
| 30 |
# output
|
|
|
|
| 31 |
if example_1:
|
| 32 |
with st.spinner('In progress.......'):
|
| 33 |
output_text = model("I am write on AI")[0]["generated_text"]
|
|
@@ -36,8 +37,8 @@ if example_1:
|
|
| 36 |
if example_2:
|
| 37 |
with st.spinner('In progress.......'):
|
| 38 |
output_text = model("This sentence has, bads grammar mistake!")[0]["generated_text"]
|
| 39 |
-
st.markdown("
|
| 40 |
if button:
|
| 41 |
with st.spinner('In progress.......'):
|
| 42 |
output_text = model(textbox)[0]["generated_text"]
|
| 43 |
-
st.markdown("
|
|
|
|
| 17 |
|
| 18 |
#prompts
|
| 19 |
st.title("Writing Assistant for you 🦄")
|
| 20 |
+
image = Image.open('new_grammar.jpg')
|
| 21 |
st.image(image, caption='Sunrise by the mountains')
|
| 22 |
st.subheader("Some examples: ")
|
| 23 |
example_1 = st.button("I am write on AI")
|
|
|
|
| 28 |
button = st.button('Detect grammar mistakes:')
|
| 29 |
|
| 30 |
# output
|
| 31 |
+
st.subheader("Correct sentence: ")
|
| 32 |
if example_1:
|
| 33 |
with st.spinner('In progress.......'):
|
| 34 |
output_text = model("I am write on AI")[0]["generated_text"]
|
|
|
|
| 37 |
if example_2:
|
| 38 |
with st.spinner('In progress.......'):
|
| 39 |
output_text = model("This sentence has, bads grammar mistake!")[0]["generated_text"]
|
| 40 |
+
st.markdown("## "+output_text)
|
| 41 |
if button:
|
| 42 |
with st.spinner('In progress.......'):
|
| 43 |
output_text = model(textbox)[0]["generated_text"]
|
| 44 |
+
st.markdown("## "+output_text)
|