mattiashallberg commited on
Commit
34875fd
1 Parent(s): ef92ba9

added login

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -5,15 +5,15 @@ import os
5
  # HF_TOKEN = os.environ.get('HUGGING_FACE_HUB_TOKEN')
6
  HF_TOKEN = os.environ.get('hf_access_to_private_space2')
7
 
 
 
 
 
 
 
8
  # gr.load(name="Attuned-Communication-Bot", src="spaces").launch()
9
  # gr.load(name="spaces/attuned-ai/Attuned-Communication-Bot", hf_token=HF_TOKEN, src="spaces").launch()
10
  # demo = gr.load("attuned-ai/Attuned-Communication-Bot", src="spaces", hf_token=HF_TOKEN)
11
  demo = gr.load("attuned-ai/TestPrivateSpace", src="spaces", hf_token=HF_TOKEN)
12
- demo.launch()
13
-
14
- # login works
15
- # def environ_auth(username, password):
16
- # if username == os.environ["username"] and password == os.environ["password"]:
17
- # return True
18
- # else:
19
- # return False
 
5
  # HF_TOKEN = os.environ.get('HUGGING_FACE_HUB_TOKEN')
6
  HF_TOKEN = os.environ.get('hf_access_to_private_space2')
7
 
8
+ def environ_auth(username, password):
9
+ if username == os.environ.get('username') and password == os.environ.get('password'):
10
+ return True
11
+ else:
12
+ return False
13
+
14
  # gr.load(name="Attuned-Communication-Bot", src="spaces").launch()
15
  # gr.load(name="spaces/attuned-ai/Attuned-Communication-Bot", hf_token=HF_TOKEN, src="spaces").launch()
16
  # demo = gr.load("attuned-ai/Attuned-Communication-Bot", src="spaces", hf_token=HF_TOKEN)
17
  demo = gr.load("attuned-ai/TestPrivateSpace", src="spaces", hf_token=HF_TOKEN)
18
+ demo.queue(max_size=20)
19
+ demo.launch(auth=environ_auth).launch()