Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
import streamlit as st
|
2 |
st.set_page_config(page_title="Advanced File Downloader", layout="wide")
|
3 |
|
4 |
-
|
5 |
-
|
6 |
# Import other required packages
|
7 |
import spacy
|
8 |
import spacy.cli
|
|
|
9 |
|
10 |
@st.cache_resource
|
11 |
def load_models():
|
@@ -35,7 +34,7 @@ def load_models():
|
|
35 |
|
36 |
# Load Transformers pipeline with offline handling
|
37 |
try:
|
38 |
-
from transformers import pipeline
|
39 |
model_name = "facebook/bart-large-cnn"
|
40 |
cache_dir = os.path.expanduser('~/.cache/huggingface/transformers')
|
41 |
if os.path.exists(os.path.join(cache_dir, model_name)):
|
@@ -68,6 +67,7 @@ else:
|
|
68 |
if summarizer is None:
|
69 |
st.warning("PDF summarization features will be disabled.")
|
70 |
|
|
|
71 |
# Rest of your imports and code here...
|
72 |
|
73 |
# Rest of your code...
|
|
|
1 |
import streamlit as st
|
2 |
st.set_page_config(page_title="Advanced File Downloader", layout="wide")
|
3 |
|
|
|
|
|
4 |
# Import other required packages
|
5 |
import spacy
|
6 |
import spacy.cli
|
7 |
+
import os
|
8 |
|
9 |
@st.cache_resource
|
10 |
def load_models():
|
|
|
34 |
|
35 |
# Load Transformers pipeline with offline handling
|
36 |
try:
|
37 |
+
from transformers import pipeline
|
38 |
model_name = "facebook/bart-large-cnn"
|
39 |
cache_dir = os.path.expanduser('~/.cache/huggingface/transformers')
|
40 |
if os.path.exists(os.path.join(cache_dir, model_name)):
|
|
|
67 |
if summarizer is None:
|
68 |
st.warning("PDF summarization features will be disabled.")
|
69 |
|
70 |
+
|
71 |
# Rest of your imports and code here...
|
72 |
|
73 |
# Rest of your code...
|