From c0a671a60b3bd1d3c9d3102dc7a0c09e28f41b7e Mon Sep 17 00:00:00 2001 From: Alex Bezdieniezhnykh Date: Sat, 31 May 2025 18:06:14 +0300 Subject: [PATCH] fixes, hash fix --- api_client.py | 2 +- manual_run.py | 10 +++++----- security.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api_client.py b/api_client.py index 9aa75e9..f4c0787 100644 --- a/api_client.py +++ b/api_client.py @@ -88,7 +88,7 @@ class ApiClient: if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: print('500!') - hw_hash = Security.get_hw_hash(hardware) + hw_hash = Security.get_hw_hash(hardware_str) key = Security.get_api_encryption_key(self.credentials, hw_hash) resp_bytes = response.raw.read() diff --git a/manual_run.py b/manual_run.py index a0c34fc..2339377 100644 --- a/manual_run.py +++ b/manual_run.py @@ -13,12 +13,12 @@ from security import Security # resume_training('/azaion/dev/ai-training/runs/detect/train12/weights/last.pt') -result_dir = '/azaion/dev/ai-training/runs/detect/train12' -model_dir = path.join(models_dir, f'{prefix}2025-05-18') -shutil.copytree(result_dir, model_dir, dirs_exist_ok=True) - +# result_dir = '/azaion/dev/ai-training/runs/detect/train12' +# model_dir = path.join(models_dir, f'{prefix}2025-05-18') +# shutil.copytree(result_dir, model_dir, dirs_exist_ok=True) +# model_path = path.join(models_dir, f'{prefix[:-1]}.pt') -shutil.copy(path.join(model_dir, 'weights', 'best.pt'), model_path) +# shutil.copy(path.join(model_dir, 'weights', 'best.pt'), model_path) api_client = ApiClient() onnx_path = export_onnx(model_path) diff --git a/security.py b/security.py index 8e6e7c8..c049f23 100644 --- a/security.py +++ b/security.py @@ -54,7 +54,7 @@ class Security: @staticmethod def get_hw_hash(hardware): - key = f'Azaion_{hardware.mac_address}_{hardware.cpu}_{hardware.gpu}' + key = f'Azaion_{hardware}_%$$$)0_' return Security.calc_hash(key) @staticmethod