Commit
ยท
1e98520
1
Parent(s):
ff20e1e
Refactor submission API call and reintroduce client initialization in task_1.py
Browse files
medvqa/competitions/gi-2025/task_1.py
CHANGED
@@ -18,7 +18,6 @@ args, _ = parser.parse_known_args()
|
|
18 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
19 |
submission_file = "submission_task1.py"
|
20 |
file_from_validation = "predictions_1.json"
|
21 |
-
client = Client("SushantGautam/medvqa")
|
22 |
|
23 |
min_library = ["datasets", "transformers", 'tqdm', "gradio_client"]
|
24 |
|
@@ -33,6 +32,7 @@ except Exception:
|
|
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"
|
@@ -78,6 +78,6 @@ else:
|
|
78 |
file_path_to_upload) # Use shutil.copy here
|
79 |
result = client.predict(
|
80 |
file=handle_file(file_path_to_upload),
|
81 |
-
api_name="/
|
82 |
)
|
83 |
print(result)
|
|
|
18 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
19 |
submission_file = "submission_task1.py"
|
20 |
file_from_validation = "predictions_1.json"
|
|
|
21 |
|
22 |
min_library = ["datasets", "transformers", 'tqdm', "gradio_client"]
|
23 |
|
|
|
32 |
print("โ ๏ธโ ๏ธ Not logged in to HuggingFace! Please get your login token from https://huggingface.co/settings/tokens ๐")
|
33 |
login()
|
34 |
|
35 |
+
client = Client("SushantGautam/medvqa")
|
36 |
print("๐ Communicating with the Submission Server: Ping!")
|
37 |
result = client.predict(
|
38 |
api_name="/RefreshAPI"
|
|
|
78 |
file_path_to_upload) # Use shutil.copy here
|
79 |
result = client.predict(
|
80 |
file=handle_file(file_path_to_upload),
|
81 |
+
api_name="/add_submission"
|
82 |
)
|
83 |
print(result)
|