Spaces:
Sleeping
Sleeping
hafidhsoekma
commited on
Commit
•
6eaf265
1
Parent(s):
d978f2c
Fix bug for environment variable username and password
Browse files
README.md
CHANGED
@@ -51,7 +51,7 @@ To use AIRIS, follow these steps:
|
|
51 |
|
52 |
4. Access the application via your web browser: `http://localhost:7860`
|
53 |
|
54 |
-
5. Enter your username and password to log in. (Make sure you set APIKEY ChatGPT also username password from environment variables with syntax "AIRIS_DEMO_ACCOUNT_
|
55 |
|
56 |
6. Start the interview or survey by following the prompts provided by the application.
|
57 |
|
|
|
51 |
|
52 |
4. Access the application via your web browser: `http://localhost:7860`
|
53 |
|
54 |
+
5. Enter your username and password to log in. (Make sure you set APIKEY ChatGPT also username password from environment variables with syntax "AIRIS_DEMO_ACCOUNT_<YOUR_USERNAME>")
|
55 |
|
56 |
6. Start the interview or survey by following the prompts provided by the application.
|
57 |
|
app.py
CHANGED
@@ -20,9 +20,10 @@ def start_chatbot(input_username, input_password, input_questions, id_interview)
|
|
20 |
+ (gr.update(value="Invalid questions. Please try again."),)
|
21 |
+ (gr.update(),) * 5
|
22 |
)
|
|
|
23 |
if (
|
24 |
-
"AIRIS_DEMO_ACCOUNT_{
|
25 |
-
or os.environ["AIRIS_DEMO_ACCOUNT_{
|
26 |
):
|
27 |
return (
|
28 |
(gr.update(),) * 2
|
|
|
20 |
+ (gr.update(value="Invalid questions. Please try again."),)
|
21 |
+ (gr.update(),) * 5
|
22 |
)
|
23 |
+
print(os.environ)
|
24 |
if (
|
25 |
+
f"AIRIS_DEMO_ACCOUNT_{input_username}" not in os.environ
|
26 |
+
or os.environ[f"AIRIS_DEMO_ACCOUNT_{input_username}"] != input_password
|
27 |
):
|
28 |
return (
|
29 |
(gr.update(),) * 2
|