mrs83 commited on
Commit
80c3ede
·
unverified ·
1 Parent(s): 5f72bf5

Chores (#5)

Browse files
blossomtune_gradio/config.py CHANGED
@@ -30,12 +30,16 @@ TLS_CERT_DIR = os.getenv("TLS_CERT_DIR", "./certs/")
30
  TLS_CA_KEY_PATH = os.getenv("TLS_CA_KEY_PATH", False)
31
  TLS_CA_CERT_PATH = os.getenv("TLS_CA_CERT_PATH", False)
32
 
 
 
 
 
33
  # BlossomTune cert - To be distributed to the participants (supernodes).
34
  BLOSSOMTUNE_TLS_CERT_PATH = os.getenv(
35
  "BLOSSOMTUNE_TLS_CERT_PATH",
36
  "/data/certs/server.crt"
37
  if os.path.isdir("/data/certs")
38
- else "./data/certs/server.crt",
39
  )
40
 
41
  # Flower Apps
 
30
  TLS_CA_KEY_PATH = os.getenv("TLS_CA_KEY_PATH", False)
31
  TLS_CA_CERT_PATH = os.getenv("TLS_CA_CERT_PATH", False)
32
 
33
+ PROJECT_PATH = os.path.realpath(
34
+ os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
35
+ )
36
+
37
  # BlossomTune cert - To be distributed to the participants (supernodes).
38
  BLOSSOMTUNE_TLS_CERT_PATH = os.getenv(
39
  "BLOSSOMTUNE_TLS_CERT_PATH",
40
  "/data/certs/server.crt"
41
  if os.path.isdir("/data/certs")
42
+ else os.path.join(PROJECT_PATH, "./data/certs/server.crt"),
43
  )
44
 
45
  # Flower Apps
blossomtune_gradio/gradio_app.py CHANGED
@@ -36,7 +36,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Flower Superlink & Runner") as dem
36
  check_status_btn.click(
37
  fn=callbacks.on_check_participant_status,
38
  inputs=[hf_handle_tb, email_tb, activation_code_tb],
39
- outputs=[request_status_md],
40
  )
41
 
42
  with gr.TabItem("Admin Panel"):
 
36
  check_status_btn.click(
37
  fn=callbacks.on_check_participant_status,
38
  inputs=[hf_handle_tb, email_tb, activation_code_tb],
39
+ outputs=[request_status_md, ca_cert_download],
40
  )
41
 
42
  with gr.TabItem("Admin Panel"):
blossomtune_gradio/ui/callbacks.py CHANGED
@@ -188,7 +188,8 @@ def on_check_participant_status(
188
  return {
189
  components.request_status_md: gr.update(
190
  value=settings.get_text("auth_required_md")
191
- )
 
192
  }
193
 
194
  user_hf_handle = profile.username if is_on_space else hf_handle
@@ -196,7 +197,8 @@ def on_check_participant_status(
196
  return {
197
  components.request_status_md: gr.update(
198
  value=settings.get_text("hf_handle_empty_md")
199
- )
 
200
  }
201
 
202
  pid_to_check = user_hf_handle.strip()
@@ -209,7 +211,7 @@ def on_check_participant_status(
209
  return {
210
  components.request_status_md: gr.update(value=message),
211
  components.ca_cert_download: gr.update(
212
- value=download or "", visible=True if download else False
213
  ),
214
  }
215
 
 
188
  return {
189
  components.request_status_md: gr.update(
190
  value=settings.get_text("auth_required_md")
191
+ ),
192
+ components.ca_cert_download: gr.update(value=None, visible=False),
193
  }
194
 
195
  user_hf_handle = profile.username if is_on_space else hf_handle
 
197
  return {
198
  components.request_status_md: gr.update(
199
  value=settings.get_text("hf_handle_empty_md")
200
+ ),
201
+ components.ca_cert_download: gr.update(value=None, visible=False),
202
  }
203
 
204
  pid_to_check = user_hf_handle.strip()
 
211
  return {
212
  components.request_status_md: gr.update(value=message),
213
  components.ca_cert_download: gr.update(
214
+ value=download, visible=True if download else False
215
  ),
216
  }
217