Shaltiel commited on
Commit
cc39e19
·
1 Parent(s): fa2a7fa

Monkeypatched create inference

Browse files
Files changed (1) hide show
  1. main_backend_lighteval.py +9 -0
main_backend_lighteval.py CHANGED
@@ -17,6 +17,15 @@ def patched_init(self, *args, **kwargs):
17
  self.name = self.name.replace('.', '-')
18
  lighteval.models.endpoint_model.InferenceEndpointModelConfig.__init__ = patched_init
19
 
 
 
 
 
 
 
 
 
 
20
  from src.backend.run_eval_suite_lighteval import run_evaluation
21
  from src.backend.manage_requests import check_completed_evals, get_eval_requests, set_eval_request
22
  from src.backend.sort_queue import sort_models_by_priority
 
17
  self.name = self.name.replace('.', '-')
18
  lighteval.models.endpoint_model.InferenceEndpointModelConfig.__init__ = patched_init
19
 
20
+ import huggingface_hub
21
+ orig_create_endpoint = huggingface_hub.create_inference_endpoint
22
+ def new_create_endpoint(*args, **kwargs):
23
+ if 'custom_image' in kwargs and kwargs['custom_image']['url'] == "ghcr.io/huggingface/text-generation-inference:1.1.0":
24
+ kwargs['custom_image']['url'] = "ghcr.io/huggingface/text-generation-inference:1.4.1"
25
+ return orig_create_endpoint(*args, **kwargs)
26
+ huggingface_hub.create_inference_endpoint = new_create_endpoint
27
+
28
+
29
  from src.backend.run_eval_suite_lighteval import run_evaluation
30
  from src.backend.manage_requests import check_completed_evals, get_eval_requests, set_eval_request
31
  from src.backend.sort_queue import sort_models_by_priority