Spaces:
Runtime error
Runtime error
import streamlit as st | |
import transformers | |
import tensorflow | |
import PIL | |
from PIL import Image | |
import time | |
from transformers import pipeline | |
model_checkpoint = "Modfiededition/t5-base-fine-tuned-on-jfleg" | |
def load_model(): | |
return pipeline("text2text-generation", model=model_checkpoint) | |
model = load_model() | |
st.subheader("๋น์ ์ ์์ด ์ผ๊ธฐ์ฅ์ ์ํด! ๐ค") | |
st.markdown("๋น์ ์ ์์ด ๋ฌธ๋ฒ์ ์ฒดํฌํด ๋๋ฆฝ๋๋ค.!") | |
textbox = st.text_area('Write your text in this box:', '',height=10, max_chars=300 ) | |
button = st.button('Detect grammar mistakes:') | |
# output | |
st.subheader("Correct sentence: ") | |
if button: | |
with st.spinner('In progress.......'): | |
if textbox: | |
output_text = model(textbox)[0]["generated_text"] | |
else: | |
output_text = " " | |
st.markdown("## "+output_text) | |