Skip to content

Commit

Permalink
fix: uninitialized streamlit key
Browse files Browse the repository at this point in the history
  • Loading branch information
sean1832 committed May 2, 2023
1 parent b03350a commit 31d08eb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
43 changes: 22 additions & 21 deletions src/Components/StreamlitSetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
if not st.session_state.get('MANIFEST'):
st.session_state["MANIFEST"] = file_io.read_json("src/manifest.json")
4 changes: 2 additions & 2 deletions src/SumGPT.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 31d08eb

Please sign in to comment.