@@ -38,26 +38,6 @@ def __init__(self, name: str, adapter_type: AdapterType):
3838 """set when the adapter is added to a backend"""
3939
4040
41- class OpenAIAdapter (Adapter ):
42- """Adapter for OpenAIBackends."""
43-
44- @abc .abstractmethod
45- def get_open_ai_path (
46- self ,
47- base_model_name : str ,
48- server_type : _ServerType = _ServerType .LOCALHOST ,
49- remote_path : str | None = None ,
50- ) -> str :
51- """Returns the path needed to load the adapter.
52-
53- Args:
54- base_model_name: the base model; typically the last part of the huggingface model id like "granite-3.3-8b-instruct"
55- server_type: the server type (ie LOCALHOST / OPENAI); usually the backend has information on this
56- remote_path: optional; used only if the server_type is REMOTE_VLLM; base path at which to find the adapter
57- """
58- ...
59-
60-
6141class LocalHFAdapter (Adapter ):
6242 """Adapter for LocalHFBackends."""
6343
@@ -71,7 +51,7 @@ def get_local_hf_path(self, base_model_name: str) -> str:
7151 ...
7252
7353
74- class GraniteCommonAdapter (OpenAIAdapter , LocalHFAdapter ):
54+ class GraniteCommonAdapter (LocalHFAdapter ):
7555 """Adapter for intrinsics that utilize the ``granite-common`` library."""
7656
7757 def __init__ (
@@ -149,35 +129,6 @@ def __init__(
149129 assert config_dict is not None # Code above should initialize this variable
150130 self .config : dict = config_dict
151131
152- def get_open_ai_path (
153- self ,
154- base_model_name : str ,
155- server_type : _ServerType = _ServerType .LOCALHOST ,
156- remote_path : str | None = None ,
157- ) -> str :
158- """Returns the path needed to load the adapter.
159-
160- Args:
161- base_model_name: the base model; typically the last part of the huggingface
162- model id like "granite-3.3-8b-instruct"
163- server_type: the server type (ie LOCALHOST / OPENAI); usually the backend
164- has information on this
165- remote_path: optional; used only if the server_type is REMOTE_VLLM; base
166- path at which to find the adapter
167- """
168- if server_type == _ServerType .LOCALHOST :
169- path = self .download_and_get_path (base_model_name )
170- elif server_type == _ServerType .REMOTE_VLLM :
171- if remote_path is None :
172- remote_path = "rag-intrinsics-lib"
173- path = self .get_path_on_remote (base_model_name , remote_path )
174- else :
175- raise ValueError (
176- f"{ self } not supported for OpenAIBackend with server_type: { server_type } "
177- )
178-
179- return path
180-
181132 def get_local_hf_path (self , base_model_name : str ) -> str :
182133 """Returns the path needed to load the adapter.
183134
@@ -207,11 +158,6 @@ def download_and_get_path(self, base_model_name: str) -> str:
207158 )
208159 )
209160
210- def get_path_on_remote (self , base_model_name : str , base_path : str ) -> str :
211- """Assumes the files have already been downloaded on the remote server."""
212- # TODO: This will break when we switch to the new repo!!!
213- return f"./{ base_path } /{ self .name } /{ self .adapter_type .value } /{ base_model_name } "
214-
215161
216162T = TypeVar ("T" )
217163
0 commit comments