sabssag commited on
Commit
8a1efb0
·
verified ·
1 Parent(s): 8a731f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -16
app.py CHANGED
@@ -1,28 +1,13 @@
1
  import streamlit as st
2
  from transformers import BartTokenizer, BartForConditionalGeneration, pipeline
3
- import zipfile
4
- import os
5
  import nltk
6
 
7
  # Download NLTK data
8
  nltk.download('punkt')
9
  from nltk.tokenize import sent_tokenize
10
 
11
- # Define the path to the saved model zip file (ensure there is no extra space)
12
- zip_model_path = 'bartzip.zip'
13
-
14
  # Define the directory to extract the model
15
- model_dir = './model'
16
-
17
- # Unzip the model
18
- 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, 'Bart_model')
23
-
24
- # Print out the model_path for debugging
25
- print("Model Path:", model_path)
26
 
27
  # Verify that the directory exists and contains the necessary files
28
  if not os.path.exists(model_path):
 
1
  import streamlit as st
2
  from transformers import BartTokenizer, BartForConditionalGeneration, pipeline
 
 
3
  import nltk
4
 
5
  # Download NLTK data
6
  nltk.download('punkt')
7
  from nltk.tokenize import sent_tokenize
8
 
 
 
 
9
  # Define the directory to extract the model
10
+ model_path = './bart_model'
 
 
 
 
 
 
 
 
 
 
11
 
12
  # Verify that the directory exists and contains the necessary files
13
  if not os.path.exists(model_path):