Spaces:
Paused
Paused
Add default namespace
Browse files
src/backend/run_eval_suite_lighteval.py
CHANGED
@@ -11,11 +11,15 @@ from src.backend.manage_requests import EvalRequest
|
|
11 |
|
12 |
logging.getLogger("openai").setLevel(logging.WARNING)
|
13 |
|
|
|
|
|
|
|
|
|
14 |
def run_evaluation(eval_request: EvalRequest, task_names: str, batch_size: int, local_dir: str, accelerator: str, region: str, vendor: str, instance_size: str, instance_type: str, limit=None):
|
15 |
if limit:
|
16 |
print("WARNING: --limit SHOULD ONLY BE USED FOR TESTING. REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT.")
|
17 |
|
18 |
-
args =
|
19 |
"endpoint_model_name":f"{eval_request.model}_{eval_request.precision}".lower(),
|
20 |
"accelerator": accelerator,
|
21 |
"vendor": vendor,
|
|
|
11 |
|
12 |
logging.getLogger("openai").setLevel(logging.WARNING)
|
13 |
|
14 |
+
class DefaultNamespace(Namespace):
|
15 |
+
def __getattr__(self, name):
|
16 |
+
return self.__dict__.get(name, None)
|
17 |
+
|
18 |
def run_evaluation(eval_request: EvalRequest, task_names: str, batch_size: int, local_dir: str, accelerator: str, region: str, vendor: str, instance_size: str, instance_type: str, limit=None):
|
19 |
if limit:
|
20 |
print("WARNING: --limit SHOULD ONLY BE USED FOR TESTING. REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT.")
|
21 |
|
22 |
+
args = DefaultNamespace(**{
|
23 |
"endpoint_model_name":f"{eval_request.model}_{eval_request.precision}".lower(),
|
24 |
"accelerator": accelerator,
|
25 |
"vendor": vendor,
|