Shaltiel commited on
Commit
79410f6
·
1 Parent(s): 4debe6f

Updated container + instance type

Browse files
Files changed (1) hide show
  1. main_backend_lighteval.py +15 -12
main_backend_lighteval.py CHANGED
@@ -1,10 +1,6 @@
1
  import logging
2
  import pprint
3
 
4
- from huggingface_hub import snapshot_download
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):
@@ -17,15 +13,21 @@ def patched_init(self, *args, **kwargs):
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
@@ -84,7 +86,8 @@ def run_auto_eval():
84
  # This needs to be done
85
  #instance_size, instance_type = get_instance_for_model(eval_request)
86
  # For GPU
87
- instance_size, instance_type = "small", "g4dn.xlarge"
 
88
  # For CPU
89
  # instance_size, instance_type = "medium", "c6i"
90
 
 
1
  import logging
2
  import pprint
3
 
 
 
 
 
4
  import lighteval.models.endpoint_model
5
  class GoodInferenceEndpointModel(lighteval.models.endpoint_model.InferenceEndpointModel):
6
  def add_special_tokens(self):
 
13
  self.name = self.name.replace('.', '-')
14
  lighteval.models.endpoint_model.InferenceEndpointModelConfig.__init__ = patched_init
15
 
16
+ import huggingface_hub
17
+ orig_create_endpoint = huggingface_hub.create_inference_endpoint
18
+ def new_create_endpoint(*args, **kwargs):
19
+ print('$$$$$$$$$$$$$$$$$ here 1')
20
+ if 'custom_image' in kwargs and kwargs['custom_image']['url'] == "ghcr.io/huggingface/text-generation-inference:1.1.0":
21
+ print('$$$$$$$$$$$$$ here 2')
22
+ kwargs['custom_image']['url'] = "registry.internal.huggingface.tech/api-inference/community/text-generation-inference:gemma-ie"
23
+ return orig_create_endpoint(*args, **kwargs)
24
+ huggingface_hub.create_inference_endpoint = new_create_endpoint
25
 
26
 
27
+ from huggingface_hub import snapshot_download
28
+
29
+ logging.getLogger("openai").setLevel(logging.WARNING)
30
+
31
  from src.backend.run_eval_suite_lighteval import run_evaluation
32
  from src.backend.manage_requests import check_completed_evals, get_eval_requests, set_eval_request
33
  from src.backend.sort_queue import sort_models_by_priority
 
86
  # This needs to be done
87
  #instance_size, instance_type = get_instance_for_model(eval_request)
88
  # For GPU
89
+ # instance_size, instance_type = "small", "g4dn.xlarge"
90
+ instance_size, instance_type = "medium", "g5.2xlarge"
91
  # For CPU
92
  # instance_size, instance_type = "medium", "c6i"
93