add quantization to create requests

This commit is contained in:
Michael Yang 2024-05-07 16:38:14 -07:00
parent e403d748a3
commit 309007da80
2 changed files with 16 additions and 0 deletions

View File

@ -255,6 +255,7 @@ class Client(BaseClient):
model: str,
path: Optional[Union[str, PathLike]] = None,
modelfile: Optional[str] = None,
quantize: Optional[str] = None,
stream: bool = False,
) -> Union[Mapping[str, Any], Iterator[Mapping[str, Any]]]:
"""
@ -276,6 +277,7 @@ class Client(BaseClient):
'name': model,
'modelfile': modelfile,
'stream': stream,
'quantize': quantize,
},
stream=stream,
)
@ -537,6 +539,7 @@ class AsyncClient(BaseClient):
model: str,
path: Optional[Union[str, PathLike]] = None,
modelfile: Optional[str] = None,
quantize: Optional[str] = None,
stream: bool = False,
) -> Union[Mapping[str, Any], AsyncIterator[Mapping[str, Any]]]:
"""
@ -558,6 +561,7 @@ class AsyncClient(BaseClient):
'name': model,
'modelfile': modelfile,
'stream': stream,
'quantize': quantize,
},
stream=stream,
)

View File

@ -334,6 +334,7 @@ def test_client_create_path(httpserver: HTTPServer):
'name': 'dummy',
'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -357,6 +358,7 @@ def test_client_create_path_relative(httpserver: HTTPServer):
'name': 'dummy',
'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -389,6 +391,7 @@ def test_client_create_path_user_home(httpserver: HTTPServer, userhomedir):
'name': 'dummy',
'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -412,6 +415,7 @@ def test_client_create_modelfile(httpserver: HTTPServer):
'name': 'dummy',
'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -442,6 +446,7 @@ PARAMETER stop [/INST]
PARAMETER stop <<SYS>>
PARAMETER stop <</SYS>>''',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -478,6 +483,7 @@ def test_client_create_from_library(httpserver: HTTPServer):
'name': 'dummy',
'modelfile': 'FROM llama2',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -798,6 +804,7 @@ async def test_async_client_create_path(httpserver: HTTPServer):
'name': 'dummy',
'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -822,6 +829,7 @@ async def test_async_client_create_path_relative(httpserver: HTTPServer):
'name': 'dummy',
'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -846,6 +854,7 @@ async def test_async_client_create_path_user_home(httpserver: HTTPServer, userho
'name': 'dummy',
'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -870,6 +879,7 @@ async def test_async_client_create_modelfile(httpserver: HTTPServer):
'name': 'dummy',
'modelfile': 'FROM @sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -901,6 +911,7 @@ PARAMETER stop [/INST]
PARAMETER stop <<SYS>>
PARAMETER stop <</SYS>>''',
'stream': False,
'quantize': None,
},
).respond_with_json({})
@ -938,6 +949,7 @@ async def test_async_client_create_from_library(httpserver: HTTPServer):
'name': 'dummy',
'modelfile': 'FROM llama2',
'stream': False,
'quantize': None,
},
).respond_with_json({})