albertvillanova HF staff commited on
Commit
750f3a2
1 Parent(s): 8424f4a

Fix InferenceEndpoint name with / from model_id (#14)

Browse files

- Remove special characters from model name for InferenceEndpoint name (3aab755c328a7350b72b2cb718eeab1bd35c5fa2)
- Merge branch 'main' into pr/14 (d073e1dc38ec69ff57898e05a5bbe39aa392132a)

src/backend/run_eval_suite_lighteval.py CHANGED
@@ -1,5 +1,6 @@
1
  import json
2
  import logging
 
3
 
4
  from lighteval.logging.evaluation_tracker import EvaluationTracker
5
  from lighteval.models.model_config import InferenceEndpointModelConfig
@@ -14,6 +15,9 @@ logging.getLogger("openai").setLevel(logging.WARNING)
14
  logger = setup_logger(__name__)
15
 
16
 
 
 
 
17
  def run_evaluation(
18
  eval_request: EvalRequest,
19
  task_names: str,
@@ -67,7 +71,7 @@ def run_evaluation(
67
 
68
  model_config = InferenceEndpointModelConfig(
69
  # Endpoint parameters
70
- name=eval_request.model.replace(".", "-").lower(),
71
  repository=eval_request.model,
72
  accelerator=accelerator,
73
  vendor=vendor,
 
1
  import json
2
  import logging
3
+ import re
4
 
5
  from lighteval.logging.evaluation_tracker import EvaluationTracker
6
  from lighteval.models.model_config import InferenceEndpointModelConfig
 
15
  logger = setup_logger(__name__)
16
 
17
 
18
+ SPECIAL_CHARACTERS_PATTERN = re.compile(r"[^a-zA-Z0-9-]")
19
+
20
+
21
  def run_evaluation(
22
  eval_request: EvalRequest,
23
  task_names: str,
 
71
 
72
  model_config = InferenceEndpointModelConfig(
73
  # Endpoint parameters
74
+ name=SPECIAL_CHARACTERS_PATTERN.sub("-", eval_request.model.lower()),
75
  repository=eval_request.model,
76
  accelerator=accelerator,
77
  vendor=vendor,