Upload test_multi_lora.py with huggingface_hub
Browse files- test_multi_lora.py +23 -6
test_multi_lora.py
CHANGED
|
@@ -236,13 +236,30 @@ def main():
|
|
| 236 |
print("\n" + "=" * 60)
|
| 237 |
print("Test Summary")
|
| 238 |
print("=" * 60)
|
| 239 |
-
|
|
|
|
| 240 |
|
| 241 |
-
#
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
|
| 247 |
|
| 248 |
if __name__ == "__main__":
|
|
|
|
| 236 |
print("\n" + "=" * 60)
|
| 237 |
print("Test Summary")
|
| 238 |
print("=" * 60)
|
| 239 |
+
summary = json.dumps(results, indent=2, default=str, ensure_ascii=False)
|
| 240 |
+
print(summary)
|
| 241 |
|
| 242 |
+
# 결과를 HF repo에 업로드
|
| 243 |
+
try:
|
| 244 |
+
from huggingface_hub import HfApi
|
| 245 |
+
result_path = "/tmp/test_results.json"
|
| 246 |
+
with open(result_path, "w") as f:
|
| 247 |
+
f.write(summary)
|
| 248 |
+
api = HfApi()
|
| 249 |
+
api.upload_file(
|
| 250 |
+
path_or_fileobj=result_path,
|
| 251 |
+
path_in_repo="test_results.json",
|
| 252 |
+
repo_id="umyunsang/govon-multi-lora-test",
|
| 253 |
+
repo_type="space",
|
| 254 |
+
)
|
| 255 |
+
print("\nResults uploaded to repo as test_results.json")
|
| 256 |
+
except Exception as e:
|
| 257 |
+
print(f"\nFailed to upload results: {e}")
|
| 258 |
+
|
| 259 |
+
# 종료하지 않고 대기 (Space가 RUNNING 상태 유지)
|
| 260 |
+
print("\nTest complete. Keeping container alive...")
|
| 261 |
+
import signal
|
| 262 |
+
signal.pause()
|
| 263 |
|
| 264 |
|
| 265 |
if __name__ == "__main__":
|