Commit
·
b85bdbd
1
Parent(s):
6f7e3e7
chore: Raise error if environment variables are not set
Browse files
app.py
CHANGED
|
@@ -85,11 +85,11 @@ def refusal_condition(query):
|
|
| 85 |
with gr.Blocks() as demo:
|
| 86 |
# Check if the API_URL and TOKEN are set
|
| 87 |
if API_URL is None:
|
| 88 |
-
gr.Error("API_URL is not set as an environment variable.")
|
| 89 |
if TOKEN is None:
|
| 90 |
-
gr.Error("TOKEN is not set as an environment variable.")
|
| 91 |
if MODEL_NAME is None:
|
| 92 |
-
gr.Error("MODEL_NAME is not set as an environment variable.")
|
| 93 |
|
| 94 |
gr.Markdown(DESCRIPTION)
|
| 95 |
|
|
|
|
| 85 |
with gr.Blocks() as demo:
|
| 86 |
# Check if the API_URL and TOKEN are set
|
| 87 |
if API_URL is None:
|
| 88 |
+
raise gr.Error("API_URL is not set as an environment variable.")
|
| 89 |
if TOKEN is None:
|
| 90 |
+
raise gr.Error("TOKEN is not set as an environment variable.")
|
| 91 |
if MODEL_NAME is None:
|
| 92 |
+
raise gr.Error("MODEL_NAME is not set as an environment variable.")
|
| 93 |
|
| 94 |
gr.Markdown(DESCRIPTION)
|
| 95 |
|