Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,10 @@ if uploaded_file is not None:
|
|
31 |
text = docx2txt.process(uploaded_file)
|
32 |
# Text input for direct text entry
|
33 |
user_input = st.text_area("Or paste your text here:")
|
34 |
-
|
|
|
|
|
|
|
35 |
|
36 |
def generate_text(model, input_texts, max_length=500, print_time_taken=False):
|
37 |
# Convert input_texts to a list if it's a Dataset
|
@@ -50,4 +53,4 @@ generated_summaries = generate_text(
|
|
50 |
text, # Pass the list of documents directly
|
51 |
)
|
52 |
st.subheader("Generated Summary:")
|
53 |
-
st.write(
|
|
|
31 |
text = docx2txt.process(uploaded_file)
|
32 |
# Text input for direct text entry
|
33 |
user_input = st.text_area("Or paste your text here:")
|
34 |
+
if user_input:
|
35 |
+
text.append(user_input)
|
36 |
+
else:
|
37 |
+
text.append(text) # Prioritize user input over file
|
38 |
|
39 |
def generate_text(model, input_texts, max_length=500, print_time_taken=False):
|
40 |
# Convert input_texts to a list if it's a Dataset
|
|
|
53 |
text, # Pass the list of documents directly
|
54 |
)
|
55 |
st.subheader("Generated Summary:")
|
56 |
+
st.write(generated_summaries)
|