mirror of
https://github.com/ollama/ollama-python.git
synced 2026-01-13 21:57:16 +08:00
Model serializer to handler from keyword
This commit is contained in:
parent
427b0c6291
commit
bee11029f7
@ -401,6 +401,13 @@ class PushRequest(BaseStreamableRequest):
|
||||
|
||||
|
||||
class CreateRequest(BaseStreamableRequest):
|
||||
@model_serializer
|
||||
def serialize_model(self):
|
||||
output = {k: v for k, v in self.__dict__.items() if v is not None}
|
||||
if 'from_' in output:
|
||||
output['from'] = output.pop('from_')
|
||||
return output
|
||||
|
||||
"""
|
||||
Request to create a new model.
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user