22import streamlit as st
33import time
44from src import FileProcessor , Summarizer
5- from config .settings import settings
5+ from config .settings import settings , quality , length
66
77def main ():
88 if 'tests_run' not in st .session_state :
@@ -15,6 +15,25 @@ def main():
1515 st .session_state .tests_run = True
1616
1717 st .title ("Kaka - AI powered document summary" )
18+ sumLenght = st .radio (
19+ "Summary length" ,
20+ ["long" , "mid" , "short" ],
21+ captions = [
22+ "approximately 2/3 of the original" ,
23+ "approximately 1/2 of the original" ,
24+ "approximately 1/3 of the original"
25+ ],
26+ )
27+ sumQuality = st .radio (
28+ "Summary length" ,
29+ ["excellent" , "good" , "crapy" ],
30+ captions = [
31+ "high coherence, accurate, well-structured" ,
32+ "average quality, some simplifications allowed" ,
33+ "intentionally lower quality, possibly missing key points or slightly incoherent"
34+ ],
35+ )
36+
1837
1938 fileProcessor = FileProcessor ()
2039 fileProcessor .upload_file ()
@@ -31,7 +50,7 @@ def main():
3150
3251 if st .session_state .submitted :
3352 summarizzler = Summarizer (settings )
34- result = summarizzler .summarize (fileProcessor .get_content ())
53+ result = summarizzler .summarize (fileProcessor .get_content (), length [ sumLenght ], quality [ sumQuality ] )
3554 with st .spinner ("Summarizing your doc...." ):
3655 time .sleep (1 )
3756 st .success ("Your summary is ready:" )
0 commit comments