Spaces:
Runtime error
Runtime error
Add profinling
Browse files
app.py
CHANGED
|
@@ -2,6 +2,8 @@ import streamlit as st
|
|
| 2 |
from QA_Bot import QA_Bot
|
| 3 |
from PDF_Reader import PDF_4_QA
|
| 4 |
from PIL import Image
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Streamlit app
|
| 7 |
def main():
|
|
@@ -27,9 +29,12 @@ def main():
|
|
| 27 |
|
| 28 |
uploaded_file = st.sidebar.file_uploader("Choose a PDF file", type="pdf")
|
| 29 |
if uploaded_file is not None:
|
|
|
|
|
|
|
| 30 |
st.sidebar.success("File uploaded successfully.")
|
| 31 |
vector_store = PDF_4_QA(uploaded_file)
|
| 32 |
QA_Bot(vector_store)
|
|
|
|
| 33 |
|
| 34 |
if __name__ == '__main__':
|
| 35 |
main()
|
|
|
|
| 2 |
from QA_Bot import QA_Bot
|
| 3 |
from PDF_Reader import PDF_4_QA
|
| 4 |
from PIL import Image
|
| 5 |
+
import cProfile
|
| 6 |
+
import pstats
|
| 7 |
|
| 8 |
# Streamlit app
|
| 9 |
def main():
|
|
|
|
| 29 |
|
| 30 |
uploaded_file = st.sidebar.file_uploader("Choose a PDF file", type="pdf")
|
| 31 |
if uploaded_file is not None:
|
| 32 |
+
profiler = cProfile.Profile()
|
| 33 |
+
profiler.enable()
|
| 34 |
st.sidebar.success("File uploaded successfully.")
|
| 35 |
vector_store = PDF_4_QA(uploaded_file)
|
| 36 |
QA_Bot(vector_store)
|
| 37 |
+
profiler.disable()
|
| 38 |
|
| 39 |
if __name__ == '__main__':
|
| 40 |
main()
|