Update app.py
Browse files388 unmodified lines38939039139239339439539639739839539940040140249 unmodified lines45245345445145245545645745845945646046146245946346446546646746846946646746847047147247347459 unmodified lines534535536534535536537538539537538542539540541542388 unmodified lines st.session_state.current_file_progress = "" st.session_state.overall_progress = 0 # Przeka偶 dane do w膮tku (kopiuj dane z session_state) files_copy = st.session_state.uploaded_files.copy() brief_copy = st.session_state.research_brief # Uruchom przetwarzanie w osobnym w膮tku self.processing_thread = threading.Thread( target=self.process_files_async, args=(settings,) args=(settings, files_copy, brief_copy) ) self.processing_thread.start() st.rerun()49 unmodified lines time.sleep(2) st.rerun() def process_files_async(self, settings): """Asynchroniczne przetwarzanie plik贸w - thread-safe""" def process_files_async(self, settings, uploaded_files, research_brief): """Asynchroniczne przetwarzanie plik贸w - thread-safe z przekazanymi danymi""" try: self.log_message("馃殌 Rozpoczynam przetwarzanie plik贸w", force_local=True) total_files = len(st.session_state.uploaded_files) total_files = len(uploaded_files) # ETAP 1: Transkrypcja plik贸w for i, file_info in enumerate(st.session_state.uploaded_files): for i, file_info in enumerate(uploaded_files): # Sprawd藕 status w bezpieczny spos贸b try: if st.session_state.processing_status != 'running': self.log_message("鈴癸笍 Przetwarzanie zatrzymane przez u偶ytkownika", force_local=True) return except: # Je艣li nie mo偶na sprawdzi膰 statusu, zako艅cz print("Cannot access session_state status - stopping") return # Je艣li nie mo偶na sprawdzi膰 statusu, kontynuuj (mo偶e by膰 w middle of processing) pass try: # Update progress59 unmodified lines self.update_progress_safe(0.9, "馃搫 Generuj臋 raport badawczy...") self.log_message("馃搫 Rozpoczynam generowanie raportu", force_local=True) # Pobierz brief z session_state try: brief = st.session_state.research_brief except: brief = "" final_report = self.report_generator.generate_comprehensive_report( transcriptions_to_use, brief research_brief ) # Zapisz raportapp.py+12-15