File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed
Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change 1- # Main giga kox file
21import streamlit as st
32import time
43from src .file_processor import FileProcessor
@@ -10,9 +9,6 @@ def main():
109 st .session_state .tests_run = False
1110
1211 if not st .session_state .tests_run :
13- # test_http.test_port()
14- # test_file_ext.test_file_ext("manu.txt")
15- # test_file_ext.test_file_ext("manu.pdf")
1612 st .session_state .tests_run = True
1713
1814 st .title ("Kaka - AI powered document summary" )
@@ -49,7 +45,6 @@ def main():
4945 st .session_state .submitted = False
5046
5147 if file is not None and not st .session_state .submitted :
52- # test_file.test_file_name(file)
5348 if st .button ("Summarize" ):
5449 st .session_state .submitted = True
5550 st .rerun ()
Original file line number Diff line number Diff line change 1- # Support for various file formats
21import streamlit as st
32import os
43from typing import Optional
54from docx import Document
65import fitz
7- #from tests import test_file_ext
86
97class FileProcessor :
108 def __init__ (self ):
@@ -31,7 +29,7 @@ def upload_file(self) -> None:
3129
3230 def _read_txt (self ) -> str :
3331 return self .file .getvalue ().decode ("utf-8" )
34-
32+
3533 def _read_docx (self ) -> str :
3634 doc = Document (self .file )
3735 text = []
@@ -45,7 +43,7 @@ def _read_pdf(self) -> str:
4543 for page in doc :
4644 text += page .get_text ()
4745 return text
48-
46+
4947
5048 def get_content (self ) -> Optional [str ]:
5149 if not self .file :
You can’t perform that action at this time.
0 commit comments