Shaltiel commited on
Commit
4eba5d7
1 Parent(s): 1ba7e1c

Added monkey patch

Browse files
main_backend_lighteval.py CHANGED
@@ -5,6 +5,12 @@ from huggingface_hub import snapshot_download
5
 
6
  logging.getLogger("openai").setLevel(logging.WARNING)
7
 
 
 
 
 
 
 
8
  from src.backend.run_eval_suite_lighteval import run_evaluation
9
  from src.backend.manage_requests import check_completed_evals, get_eval_requests, set_eval_request
10
  from src.backend.sort_queue import sort_models_by_priority
 
5
 
6
  logging.getLogger("openai").setLevel(logging.WARNING)
7
 
8
+ import lighteval.models.endpoint_model
9
+ class GoodInferenceEndpointModel(lighteval.models.endpoint_model.InferenceEndpointModel):
10
+ def add_special_tokens(self):
11
+ pass
12
+ lighteval.models.endpoint_model.InferenceEndpointModel = GoodInferenceEndpointModel
13
+
14
  from src.backend.run_eval_suite_lighteval import run_evaluation
15
  from src.backend.manage_requests import check_completed_evals, get_eval_requests, set_eval_request
16
  from src.backend.sort_queue import sort_models_by_priority
src/backend/run_eval_suite_lighteval.py CHANGED
@@ -5,12 +5,9 @@ from datetime import datetime
5
  from argparse import Namespace
6
 
7
  from lighteval.main_accelerate import main, EnvConfig, create_model_config, load_model
8
- from lighteval.models.endpoint_model import InferenceEndpointModel
9
  from src.envs import RESULTS_REPO, CACHE_PATH, TOKEN
10
  from src.backend.manage_requests import EvalRequest
11
 
12
- InferenceEndpointModel.add_special_tokens = lambda *args, **kwargs: None
13
-
14
  logging.getLogger("openai").setLevel(logging.WARNING)
15
 
16
  class DefaultNamespace(Namespace):
 
5
  from argparse import Namespace
6
 
7
  from lighteval.main_accelerate import main, EnvConfig, create_model_config, load_model
 
8
  from src.envs import RESULTS_REPO, CACHE_PATH, TOKEN
9
  from src.backend.manage_requests import EvalRequest
10
 
 
 
11
  logging.getLogger("openai").setLevel(logging.WARNING)
12
 
13
  class DefaultNamespace(Namespace):