Spaces:
Running
Running
Commit
·
ad807d7
1
Parent(s):
723f018
Update README and add gradio launcher for Medico-2025 competition
Browse files- README.md +3 -3
- gradio_launcher.py +32 -0
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
sdk: gradio
|
| 3 |
sdk_version: 5.24.0
|
| 4 |
-
app_file:
|
| 5 |
---
|
| 6 |
# MedVQA
|
| 7 |
|
|
@@ -15,9 +15,9 @@ pip install -U medvqa
|
|
| 15 |
The library is under heavy development. So, we recommend to always make sure you have the latest version installed.
|
| 16 |
|
| 17 |
## Usage
|
| 18 |
-
Check [
|
| 19 |
|
| 20 |
```bash
|
| 21 |
-
medvqa validate_and_submit --competition=
|
| 22 |
```
|
| 23 |
where repo_id is your HuggingFace Model repo id (like SushantGautam/XXModelCheckpoint) with the submission script as required by the competition organizers, for eg, submission_task1.py file for task 1 and submission_task2.py for task 2.
|
|
|
|
| 1 |
---
|
| 2 |
sdk: gradio
|
| 3 |
sdk_version: 5.24.0
|
| 4 |
+
app_file: gradio_launcher.py
|
| 5 |
---
|
| 6 |
# MedVQA
|
| 7 |
|
|
|
|
| 15 |
The library is under heavy development. So, we recommend to always make sure you have the latest version installed.
|
| 16 |
|
| 17 |
## Usage
|
| 18 |
+
Check [MediaEval-Medico-2025 competition repo](https://github.com/simula/MediaEval-Medico-2025#-submission-system) for detailed submission instructions.
|
| 19 |
|
| 20 |
```bash
|
| 21 |
+
medvqa validate_and_submit --competition=medico-2025 --task=1 --repo_id=...
|
| 22 |
```
|
| 23 |
where repo_id is your HuggingFace Model repo id (like SushantGautam/XXModelCheckpoint) with the submission script as required by the competition organizers, for eg, submission_task1.py file for task 1 and submission_task2.py for task 2.
|
gradio_launcher.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
import importlib.util
|
| 4 |
+
|
| 5 |
+
# Name of the environment variable
|
| 6 |
+
ENV_VAR = "GRADIO_APP_PATH"
|
| 7 |
+
|
| 8 |
+
def main():
|
| 9 |
+
app_path = os.getenv(ENV_VAR)
|
| 10 |
+
|
| 11 |
+
if not app_path:
|
| 12 |
+
print(f"❌ Error: Environment variable '{ENV_VAR}' is not set.")
|
| 13 |
+
sys.exit(1)
|
| 14 |
+
|
| 15 |
+
if not os.path.isfile(app_path):
|
| 16 |
+
print(f"❌ Error: File at '{app_path}' does not exist.")
|
| 17 |
+
sys.exit(1)
|
| 18 |
+
|
| 19 |
+
# Dynamically import the module
|
| 20 |
+
spec = importlib.util.spec_from_file_location("gradio_app", app_path)
|
| 21 |
+
module = importlib.util.module_from_spec(spec)
|
| 22 |
+
spec.loader.exec_module(module)
|
| 23 |
+
|
| 24 |
+
# Launch the Gradio interface
|
| 25 |
+
if hasattr(module, "launch"):
|
| 26 |
+
module.launch()
|
| 27 |
+
else:
|
| 28 |
+
print("❌ Error: The specified file does not have a 'launch()' function.")
|
| 29 |
+
sys.exit(1)
|
| 30 |
+
|
| 31 |
+
if __name__ == "__main__":
|
| 32 |
+
main()
|