Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| from transformers import pipeline, PegasusForConditionalGeneration, PegasusTokenizer | |
| from fill_in_summary import FillInSummary | |
| def paraphrase(text): | |
| return text | |
| st.title('Question Generator by Eddevs') | |
| select = st.selectbox('Type', ['Question Generator', 'Paraphrasing', 'Summarization', 'Fill in the blank']) | |
| if select == "Summarization": | |
| with st.form("summarization"): | |
| # left_column, right_column = st.columns(2) | |
| # left_column.selectbox('Type', ['Question Generator', 'Paraphrasing']) | |
| #st.selectbox('Model', ['T5', 'GPT Neo-X']) | |
| input = st.text_area("Input Text") | |
| submitted = st.form_submit_button("Generate") | |
| if submitted: | |
| st.write(FillInSummary().summarize(input)) | |
| if select == "Fill in the blank": | |
| with st.form("summarization"): | |
| input = st.text_area("Input Text") | |
| submitted = st.form_submit_button("Generate") | |
| if submitted: | |
| fill = FillInSummary() | |
| summarized = fill.summarize(input) | |
| st.write(fill.blank_ne_out(summarized)) | |
| if select == "Paraphrasing": | |
| with st.form("paraphrasing"): | |
| st.selectbox('Model', ['T5', 'GPT Neo-X']) | |
| input = st.text_area("Input Text") | |
| submitted = st.form_submit_button("Generate") | |
| if submitted: | |
| st.write(paraphrase(input)) | |
| #if st.button('Generate'): | |
| # st.write(input) | |
| #st.success("We have generated 105 Questions for you") | |
| # st.snow() | |
| ##else: | |
| ##nothing here | |