From 31d08ebd1997d971dbc0c01f7072a9ee2aab5aa0 Mon Sep 17 00:00:00 2001 From: sean1832 Date: Wed, 3 May 2023 05:01:58 +1000 Subject: [PATCH] fix: uninitialized streamlit key --- src/Components/StreamlitSetup.py | 43 ++++++++++++++++---------------- src/SumGPT.py | 4 +-- src/manifest.json | 2 +- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/Components/StreamlitSetup.py b/src/Components/StreamlitSetup.py index 5bb4e3c..b57f3ce 100644 --- a/src/Components/StreamlitSetup.py +++ b/src/Components/StreamlitSetup.py @@ -2,34 +2,35 @@ import Data.caption_languages as data import Modules.file_io as file_io -st.set_page_config(page_title="SumGPT", page_icon="📝", layout="wide") +def setup(): + st.set_page_config(page_title="SumGPT", page_icon="📝", layout="wide") -if not st.session_state.get('OPENAI_API_KEY'): - st.session_state['OPENAI_API_KEY'] = None + if not st.session_state.get('OPENAI_API_KEY'): + st.session_state['OPENAI_API_KEY'] = None -if not st.session_state.get('OPENAI_PERSONA_REC'): - st.session_state['OPENAI_PERSONA_REC'] = None + if not st.session_state.get('OPENAI_PERSONA_REC'): + st.session_state['OPENAI_PERSONA_REC'] = None -if not st.session_state.get('OPENAI_PERSONA_SUM'): - st.session_state['OPENAI_PERSONA_SUM'] = None + if not st.session_state.get('OPENAI_PERSONA_SUM'): + st.session_state['OPENAI_PERSONA_SUM'] = None -if not st.session_state.get('CHUNK_SIZE'): - st.session_state['CHUNK_SIZE'] = None + if not st.session_state.get('CHUNK_SIZE'): + st.session_state['CHUNK_SIZE'] = None -if not st.session_state.get('OPENAI_PARAMS'): - st.session_state['OPENAI_PARAMS'] = None + if not st.session_state.get('OPENAI_PARAMS'): + st.session_state['OPENAI_PARAMS'] = None -if not st.session_state.get('DELAY'): - st.session_state['DELAY'] = 0 + if not st.session_state.get('DELAY'): + st.session_state['DELAY'] = 0 -if not st.session_state.get('FINAL_SUMMARY_MODE'): - st.session_state['FINAL_SUMMARY_MODE'] = False + if not st.session_state.get('FINAL_SUMMARY_MODE'): + st.session_state['FINAL_SUMMARY_MODE'] = False -if not st.session_state.get('CAPTION_LANGUAGES'): - st.session_state['CAPTION_LANGUAGES'] = data.languages + data.auto_languages + if not st.session_state.get('CAPTION_LANGUAGES'): + st.session_state['CAPTION_LANGUAGES'] = data.languages + data.auto_languages -if not st.session_state.get('PREVIOUS_RESULTS'): - st.session_state['PREVIOUS_RESULTS'] = None + if not st.session_state.get('PREVIOUS_RESULTS'): + st.session_state['PREVIOUS_RESULTS'] = None -if not st.session_state.get('MANIFEST'): - st.session_state["MANIFEST"] = file_io.read_json("src/manifest.json") \ No newline at end of file + if not st.session_state.get('MANIFEST'): + st.session_state["MANIFEST"] = file_io.read_json("src/manifest.json") \ No newline at end of file diff --git a/src/SumGPT.py b/src/SumGPT.py index 2989e92..83bce51 100644 --- a/src/SumGPT.py +++ b/src/SumGPT.py @@ -1,8 +1,8 @@ import asyncio -import Components import streamlit as st -import Components.StreamlitSetup +import Components.StreamlitSetup as StreamlitSetup +StreamlitSetup.setup() import Modules.Youtube from Components.sidebar import sidebar diff --git a/src/manifest.json b/src/manifest.json index 60a296b..731522c 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { "name": "SumGPT", - "version": "1.0.7", + "version": "1.0.8", "license": { "type": "MIT", "url": "https://github.com/sean1832/SumGPT/blob/master/LICENSE"