sunbal7 commited on
Commit
e33f38e
·
verified ·
1 Parent(s): 19d890f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -7,15 +7,18 @@ from fpdf import FPDF
7
  import tempfile
8
  import os
9
 
10
- # Load models (you can replace with smaller or local models if needed)
 
 
 
 
 
11
  @st.cache_resource
12
  def load_models():
13
  summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
14
  qa_pipeline = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
15
  return summarizer, qa_pipeline
16
 
17
- summarizer, qa_pipeline = load_models()
18
-
19
  # Text extraction
20
  def extract_text(uploaded_file):
21
  ext = os.path.splitext(uploaded_file.name)[-1].lower()
 
7
  import tempfile
8
  import os
9
 
10
+
11
+
12
+ st.set_page_config(page_title="AI Study Plan Assistant", layout="wide")
13
+
14
+
15
+ # Caching model load
16
  @st.cache_resource
17
  def load_models():
18
  summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
19
  qa_pipeline = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
20
  return summarizer, qa_pipeline
21
 
 
 
22
  # Text extraction
23
  def extract_text(uploaded_file):
24
  ext = os.path.splitext(uploaded_file.name)[-1].lower()