Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ nltk.download('punkt')
|
|
9 |
from nltk.tokenize import sent_tokenize
|
10 |
|
11 |
# Define the path to the saved model zip file
|
12 |
-
zip_model_path = '
|
13 |
|
14 |
# Define the directory to extract the model
|
15 |
model_dir = './model'
|
@@ -19,7 +19,7 @@ with zipfile.ZipFile(zip_model_path, 'r') as zip_ref:
|
|
19 |
zip_ref.extractall(model_dir)
|
20 |
|
21 |
# After unzipping, the model should be in a specific directory, check the directory structure
|
22 |
-
model_path = os.path.join(model_dir, '
|
23 |
|
24 |
# Verify that the directory exists and contains the necessary files
|
25 |
if not os.path.exists(model_path):
|
@@ -33,7 +33,7 @@ else:
|
|
33 |
summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
|
34 |
|
35 |
# Set the title for the Streamlit app
|
36 |
-
st.title("
|
37 |
|
38 |
# Text input for the user
|
39 |
text = st.text_area("Enter your text: ")
|
|
|
9 |
from nltk.tokenize import sent_tokenize
|
10 |
|
11 |
# Define the path to the saved model zip file
|
12 |
+
zip_model_path = 'bart_model-20240724T051306Z-001.zip'
|
13 |
|
14 |
# Define the directory to extract the model
|
15 |
model_dir = './model'
|
|
|
19 |
zip_ref.extractall(model_dir)
|
20 |
|
21 |
# After unzipping, the model should be in a specific directory, check the directory structure
|
22 |
+
model_path = os.path.join(model_dir, 'Bart_model')
|
23 |
|
24 |
# Verify that the directory exists and contains the necessary files
|
25 |
if not os.path.exists(model_path):
|
|
|
33 |
summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
|
34 |
|
35 |
# Set the title for the Streamlit app
|
36 |
+
st.title("BART Summary Generator")
|
37 |
|
38 |
# Text input for the user
|
39 |
text = st.text_area("Enter your text: ")
|