SushantGautam commited on
Commit
1ef368a
Β·
1 Parent(s): e31e0cb

Enhance Gradio interface with a friendly server response and integrate submission server ping functionality

Browse files
gradio_interface.py CHANGED
@@ -116,7 +116,7 @@ def add_submission(file):
116
 
117
 
118
  def refresh_page():
119
- return "API server is alive!"
120
 
121
 
122
  # Define Gradio interface components
 
116
 
117
 
118
  def refresh_page():
119
+ return "Pong! Submission server is alive! 😊"
120
 
121
 
122
  # Define Gradio interface components
medvqa/competitions/gi-2025/task_1.py CHANGED
@@ -1,3 +1,4 @@
 
1
  from gradio_client import Client, handle_file
2
  from huggingface_hub import snapshot_download, login, whoami
3
  import sys
@@ -32,6 +33,13 @@ except Exception:
32
  print("⚠️⚠️ Not logged in to HuggingFace! Please get your login token from https://huggingface.co/settings/tokens 🌐")
33
  login()
34
 
 
 
 
 
 
 
 
35
  hf_username = whoami()['name']
36
  assert len(hf_username) > 0, "🚫 HuggingFace login failed for some reason"
37
  current_timestamp = int(time.time())
 
1
+ from gradio_client import Client
2
  from gradio_client import Client, handle_file
3
  from huggingface_hub import snapshot_download, login, whoami
4
  import sys
 
33
  print("⚠️⚠️ Not logged in to HuggingFace! Please get your login token from https://huggingface.co/settings/tokens 🌐")
34
  login()
35
 
36
+ print("πŸ’“ Communicating with the Submission Server: Ping!")
37
+ result = client.predict(
38
+ api_name="/RefreshAPI"
39
+ )
40
+ print(result)
41
+
42
+
43
  hf_username = whoami()['name']
44
  assert len(hf_username) > 0, "🚫 HuggingFace login failed for some reason"
45
  current_timestamp = int(time.time())