Spaces:
Runtime error
Runtime error
Commit
·
99c241a
1
Parent(s):
02bf303
Update app.py
Browse files
app.py
CHANGED
@@ -4,18 +4,14 @@ import json
|
|
4 |
import os
|
5 |
|
6 |
HF_TOKEN = os.environ.get("hfkey")
|
7 |
-
# Retrieve the serialized list of username and password pairs from environment variable
|
8 |
|
9 |
-
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
# demo.launch(auth=credentials)
|
17 |
-
|
18 |
-
gr.load(name="spaces/bentobytes/LawGPT", api_key=HF_TOKEN).launch()
|
19 |
|
20 |
|
21 |
# client = Client("bentobytes/LawGPT", hf_token=HF_TOKEN)
|
|
|
4 |
import os
|
5 |
|
6 |
HF_TOKEN = os.environ.get("hfkey")
|
|
|
7 |
|
8 |
+
credentials_json = os.environ.get("CREDENTIALS")
|
9 |
|
10 |
+
if credentials_json is None:
|
11 |
+
print("Error: Please set the CREDENTIALS")
|
12 |
+
else:
|
13 |
+
credentials = json.loads(credentials_json)
|
14 |
+
gr.load(name="spaces/bentobytes/LawGPT", api_key=HF_TOKEN).launch(auth=credentials)
|
|
|
|
|
|
|
15 |
|
16 |
|
17 |
# client = Client("bentobytes/LawGPT", hf_token=HF_TOKEN)
|