Skip to content

Commit 31d08eb

Browse files
committed
fix: uninitialized streamlit key
1 parent b03350a commit 31d08eb

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

src/Components/StreamlitSetup.py

+22-21
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,35 @@
22
import Data.caption_languages as data
33
import Modules.file_io as file_io
44

5-
st.set_page_config(page_title="SumGPT", page_icon="📝", layout="wide")
5+
def setup():
6+
st.set_page_config(page_title="SumGPT", page_icon="📝", layout="wide")
67

7-
if not st.session_state.get('OPENAI_API_KEY'):
8-
st.session_state['OPENAI_API_KEY'] = None
8+
if not st.session_state.get('OPENAI_API_KEY'):
9+
st.session_state['OPENAI_API_KEY'] = None
910

10-
if not st.session_state.get('OPENAI_PERSONA_REC'):
11-
st.session_state['OPENAI_PERSONA_REC'] = None
11+
if not st.session_state.get('OPENAI_PERSONA_REC'):
12+
st.session_state['OPENAI_PERSONA_REC'] = None
1213

13-
if not st.session_state.get('OPENAI_PERSONA_SUM'):
14-
st.session_state['OPENAI_PERSONA_SUM'] = None
14+
if not st.session_state.get('OPENAI_PERSONA_SUM'):
15+
st.session_state['OPENAI_PERSONA_SUM'] = None
1516

16-
if not st.session_state.get('CHUNK_SIZE'):
17-
st.session_state['CHUNK_SIZE'] = None
17+
if not st.session_state.get('CHUNK_SIZE'):
18+
st.session_state['CHUNK_SIZE'] = None
1819

19-
if not st.session_state.get('OPENAI_PARAMS'):
20-
st.session_state['OPENAI_PARAMS'] = None
20+
if not st.session_state.get('OPENAI_PARAMS'):
21+
st.session_state['OPENAI_PARAMS'] = None
2122

22-
if not st.session_state.get('DELAY'):
23-
st.session_state['DELAY'] = 0
23+
if not st.session_state.get('DELAY'):
24+
st.session_state['DELAY'] = 0
2425

25-
if not st.session_state.get('FINAL_SUMMARY_MODE'):
26-
st.session_state['FINAL_SUMMARY_MODE'] = False
26+
if not st.session_state.get('FINAL_SUMMARY_MODE'):
27+
st.session_state['FINAL_SUMMARY_MODE'] = False
2728

28-
if not st.session_state.get('CAPTION_LANGUAGES'):
29-
st.session_state['CAPTION_LANGUAGES'] = data.languages + data.auto_languages
29+
if not st.session_state.get('CAPTION_LANGUAGES'):
30+
st.session_state['CAPTION_LANGUAGES'] = data.languages + data.auto_languages
3031

31-
if not st.session_state.get('PREVIOUS_RESULTS'):
32-
st.session_state['PREVIOUS_RESULTS'] = None
32+
if not st.session_state.get('PREVIOUS_RESULTS'):
33+
st.session_state['PREVIOUS_RESULTS'] = None
3334

34-
if not st.session_state.get('MANIFEST'):
35-
st.session_state["MANIFEST"] = file_io.read_json("src/manifest.json")
35+
if not st.session_state.get('MANIFEST'):
36+
st.session_state["MANIFEST"] = file_io.read_json("src/manifest.json")

src/SumGPT.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import asyncio
2-
import Components
32
import streamlit as st
43

5-
import Components.StreamlitSetup
4+
import Components.StreamlitSetup as StreamlitSetup
5+
StreamlitSetup.setup()
66

77
import Modules.Youtube
88
from Components.sidebar import sidebar

src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SumGPT",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"license": {
55
"type": "MIT",
66
"url": "https://github.com/sean1832/SumGPT/blob/master/LICENSE"

0 commit comments

Comments
 (0)