bentobytes commited on
Commit
99c241a
·
1 Parent(s): 02bf303

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
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
- # credentials_json = os.environ.get("CREDENTIALS")
10
 
11
- # if credentials_json is None:
12
- # print("Error: Please set the CREDENTIALS environment variable with a JSON representation of the username and password pairs.")
13
- # else:
14
- # # Parse the JSON string into a list of tuples
15
- # credentials = json.loads(credentials_json)
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)