Spaces:
Running
Running
phyloforfun
commited on
Commit
•
5f4616c
1
Parent(s):
2b81df8
update set api keys
Browse files
app.py
CHANGED
@@ -283,6 +283,15 @@ def create_private_file():
|
|
283 |
st.title("VoucherVision")
|
284 |
col_private, _ = st.columns([12, 2])
|
285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
# Fetch the environment variables or set to empty if not found
|
287 |
env_variables = {
|
288 |
'OPENAI_API_KEY': os.getenv('OPENAI_API_KEY'),
|
@@ -344,8 +353,7 @@ def create_private_file():
|
|
344 |
st.write("##")
|
345 |
st.button("Test OCR", on_click=test_API, args=['google_vision',c_in_ocr,openai_api_key,azure_openai_api_version,azure_openai_api_key,
|
346 |
azure_openai_api_base,azure_openai_organization,azure_openai_api_type,google_vision,google_palm])
|
347 |
-
|
348 |
-
google_vision = None
|
349 |
|
350 |
if os.getenv('OPENAI_API_KEY') is None:
|
351 |
st.write("---")
|
@@ -365,8 +373,7 @@ def create_private_file():
|
|
365 |
st.write("##")
|
366 |
st.button("Test OpenAI", on_click=test_API, args=['openai',c_in_openai,openai_api_key,azure_openai_api_version,azure_openai_api_key,
|
367 |
azure_openai_api_base,azure_openai_organization,azure_openai_api_type,google_vision,google_palm])
|
368 |
-
|
369 |
-
openai_api_key = None
|
370 |
|
371 |
|
372 |
if os.getenv('AZURE_API_KEY') is None:
|
@@ -402,12 +409,7 @@ def create_private_file():
|
|
402 |
st.write("##")
|
403 |
st.button("Test Azure OpenAI", on_click=test_API, args=['azure_openai',c_in_azure,openai_api_key,azure_openai_api_version,azure_openai_api_key,
|
404 |
azure_openai_api_base,azure_openai_organization,azure_openai_api_type,google_vision,google_palm])
|
405 |
-
|
406 |
-
azure_openai_api_version = None
|
407 |
-
azure_openai_api_key = None
|
408 |
-
azure_openai_api_base = None
|
409 |
-
azure_openai_organization = None
|
410 |
-
azure_openai_api_type = None
|
411 |
|
412 |
|
413 |
if os.getenv('PALM_API_KEY') is None:
|
@@ -426,8 +428,6 @@ def create_private_file():
|
|
426 |
st.write("##")
|
427 |
st.button("Test PaLM 2", on_click=test_API, args=['palm',c_in_palm,openai_api_key,azure_openai_api_version,azure_openai_api_key,
|
428 |
azure_openai_api_base,azure_openai_organization,azure_openai_api_type,google_vision,google_palm])
|
429 |
-
else:
|
430 |
-
google_palm = None
|
431 |
|
432 |
st.button("Set API Keys",type='primary', on_click=set_API_keys, args=[openai_api_key,azure_openai_api_version,azure_openai_api_key,
|
433 |
azure_openai_api_base,azure_openai_organization,azure_openai_api_type,google_vision,google_palm])
|
|
|
283 |
st.title("VoucherVision")
|
284 |
col_private, _ = st.columns([12, 2])
|
285 |
|
286 |
+
openai_api_key = None
|
287 |
+
azure_openai_api_version = None
|
288 |
+
azure_openai_api_key = None
|
289 |
+
azure_openai_api_base = None
|
290 |
+
azure_openai_organization = None
|
291 |
+
azure_openai_api_type = None
|
292 |
+
google_vision = None
|
293 |
+
google_palm = None
|
294 |
+
|
295 |
# Fetch the environment variables or set to empty if not found
|
296 |
env_variables = {
|
297 |
'OPENAI_API_KEY': os.getenv('OPENAI_API_KEY'),
|
|
|
353 |
st.write("##")
|
354 |
st.button("Test OCR", on_click=test_API, args=['google_vision',c_in_ocr,openai_api_key,azure_openai_api_version,azure_openai_api_key,
|
355 |
azure_openai_api_base,azure_openai_organization,azure_openai_api_type,google_vision,google_palm])
|
356 |
+
|
|
|
357 |
|
358 |
if os.getenv('OPENAI_API_KEY') is None:
|
359 |
st.write("---")
|
|
|
373 |
st.write("##")
|
374 |
st.button("Test OpenAI", on_click=test_API, args=['openai',c_in_openai,openai_api_key,azure_openai_api_version,azure_openai_api_key,
|
375 |
azure_openai_api_base,azure_openai_organization,azure_openai_api_type,google_vision,google_palm])
|
376 |
+
|
|
|
377 |
|
378 |
|
379 |
if os.getenv('AZURE_API_KEY') is None:
|
|
|
409 |
st.write("##")
|
410 |
st.button("Test Azure OpenAI", on_click=test_API, args=['azure_openai',c_in_azure,openai_api_key,azure_openai_api_version,azure_openai_api_key,
|
411 |
azure_openai_api_base,azure_openai_organization,azure_openai_api_type,google_vision,google_palm])
|
412 |
+
|
|
|
|
|
|
|
|
|
|
|
413 |
|
414 |
|
415 |
if os.getenv('PALM_API_KEY') is None:
|
|
|
428 |
st.write("##")
|
429 |
st.button("Test PaLM 2", on_click=test_API, args=['palm',c_in_palm,openai_api_key,azure_openai_api_version,azure_openai_api_key,
|
430 |
azure_openai_api_base,azure_openai_organization,azure_openai_api_type,google_vision,google_palm])
|
|
|
|
|
431 |
|
432 |
st.button("Set API Keys",type='primary', on_click=set_API_keys, args=[openai_api_key,azure_openai_api_version,azure_openai_api_key,
|
433 |
azure_openai_api_base,azure_openai_organization,azure_openai_api_type,google_vision,google_palm])
|