Piux24 commited on
Commit
9a21e73
·
verified ·
1 Parent(s): 5f0ac34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -12,4 +12,15 @@ def chat_response(message):
12
  iface = gr.Interface(fn=chat_response, inputs="text", outputs="text", title="Bit GPT 0.2.8")
13
 
14
  # Launch app
15
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
12
  iface = gr.Interface(fn=chat_response, inputs="text", outputs="text", title="Bit GPT 0.2.8")
13
 
14
  # Launch app
15
+ iface.launch()
16
+
17
+ import PyPDF2
18
+
19
+ def read_pdf(file_path):
20
+ with open(file_path, "rb") as file:
21
+ reader = PyPDF2.PdfReader(file)
22
+ text = "\n".join([page.extract_text() for page in reader.pages if page.extract_text()])
23
+ return text
24
+
25
+ syllabus_text = read_pdf("syllabus.pdf")
26
+ print("Syllabus Loaded Successfully!")