Spaces:
Sleeping
Sleeping
Umang Chaudhry
commited on
Commit
·
6648371
1
Parent(s):
f7c16f8
fixed logos, api keys
Browse files
app.py
CHANGED
@@ -54,12 +54,16 @@ def decrypt(encrypted_api_key: bytes, fernet) -> str:
|
|
54 |
|
55 |
|
56 |
def add_logos():
|
|
|
|
|
57 |
free_speech_logo = './free_speech_app/logos/Future-of-Free-Speech-logo.png'
|
58 |
vu_logo = './free_speech_app/logos/Vanderbilt-University-Logo.png'
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
63 |
|
64 |
|
65 |
# Render the login module
|
@@ -151,7 +155,17 @@ if authentication_status:
|
|
151 |
os.environ["OPENAI_API_KEY"] = st.session_state.api_key
|
152 |
# add condition to check for passphrase to allow use of DSI api key stored in secrets
|
153 |
if (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase"]):
|
|
|
154 |
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
chat_mdl = ChatOpenAI(model_name='gpt-4', temperature=0.1)
|
156 |
|
157 |
if chat_mdl is not None:
|
@@ -221,11 +235,17 @@ if authentication_status:
|
|
221 |
os.environ['OPENAI_API_KEY'] = st.session_state.api_key
|
222 |
# add condition to check for passphrase to allow use of DSI api key stored in secrets
|
223 |
if (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase"]):
|
224 |
-
#
|
225 |
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key"]
|
226 |
elif (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase2"]):
|
227 |
-
#
|
228 |
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key2"]
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
chat_mdl = ChatOpenAI(
|
230 |
model_name='gpt-4', temperature=0.1)
|
231 |
|
|
|
54 |
|
55 |
|
56 |
def add_logos():
|
57 |
+
st.title("Freequalizer")
|
58 |
+
left_col_log, right_col_log = st.columns(2)
|
59 |
free_speech_logo = './free_speech_app/logos/Future-of-Free-Speech-logo.png'
|
60 |
vu_logo = './free_speech_app/logos/Vanderbilt-University-Logo.png'
|
61 |
+
with left_col_log:
|
62 |
+
st.image(free_speech_logo, caption=None, width=200, use_column_width=None,
|
63 |
+
clamp=False, channels="RGB", output_format="auto")
|
64 |
+
with right_col_log:
|
65 |
+
st.image(vu_logo, caption=None, width=200, use_column_width=None,
|
66 |
+
clamp=False, channels="RGB", output_format="auto")
|
67 |
|
68 |
|
69 |
# Render the login module
|
|
|
155 |
os.environ["OPENAI_API_KEY"] = st.session_state.api_key
|
156 |
# add condition to check for passphrase to allow use of DSI api key stored in secrets
|
157 |
if (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase"]):
|
158 |
+
#umang key
|
159 |
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key"]
|
160 |
+
elif (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase2"]):
|
161 |
+
#abbie key
|
162 |
+
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key2"]
|
163 |
+
elif (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase3"]):
|
164 |
+
#myranda key
|
165 |
+
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key3"]
|
166 |
+
elif (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase4"]):
|
167 |
+
#jasmine key
|
168 |
+
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key4"]
|
169 |
chat_mdl = ChatOpenAI(model_name='gpt-4', temperature=0.1)
|
170 |
|
171 |
if chat_mdl is not None:
|
|
|
235 |
os.environ['OPENAI_API_KEY'] = st.session_state.api_key
|
236 |
# add condition to check for passphrase to allow use of DSI api key stored in secrets
|
237 |
if (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase"]):
|
238 |
+
#umang key
|
239 |
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key"]
|
240 |
elif (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase2"]):
|
241 |
+
#abbie key
|
242 |
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key2"]
|
243 |
+
elif (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase3"]):
|
244 |
+
#myranda key
|
245 |
+
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key3"]
|
246 |
+
elif (os.environ["OPENAI_API_KEY"] == st.secrets["secret_passphrase4"]):
|
247 |
+
#jasmine key
|
248 |
+
os.environ["OPENAI_API_KEY"] = st.secrets["dsi_openai_key4"]
|
249 |
chat_mdl = ChatOpenAI(
|
250 |
model_name='gpt-4', temperature=0.1)
|
251 |
|