Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,12 @@
|
|
1 |
-
from transformers import pipeline
|
2 |
-
unmasker = pipeline('fill-mask', model='distilbert-base-uncased')
|
3 |
-
unmasker("Hello I'm a [MASK] model.")
|
4 |
-
|
5 |
-
|
6 |
import streamlit as st
|
7 |
from transformers import pipeline
|
8 |
|
9 |
def summarize_text(text):
|
10 |
unmasker = pipeline('fill-mask', model='distilbert-base-uncased')
|
11 |
-
|
12 |
-
return
|
13 |
|
14 |
def main():
|
15 |
-
st.title("Text Summarization App")
|
16 |
-
st.write("Enter your text below:")
|
17 |
user_input = st.text_area("Input Text Here")
|
18 |
if st.button("Summarize"):
|
19 |
summary = summarize_text(user_input)
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
def summarize_text(text):
|
5 |
unmasker = pipeline('fill-mask', model='distilbert-base-uncased')
|
6 |
+
text_input = unmasker(text, do_sample=True)[0]['text_input']
|
7 |
+
return text_input
|
8 |
|
9 |
def main():
|
|
|
|
|
10 |
user_input = st.text_area("Input Text Here")
|
11 |
if st.button("Summarize"):
|
12 |
summary = summarize_text(user_input)
|