diff --git a/integration-tests/models/test_grammar_response_format_llama.py b/integration-tests/models/test_grammar_response_format_llama.py index 8a905e64..424dcaaf 100644 --- a/integration-tests/models/test_grammar_response_format_llama.py +++ b/integration-tests/models/test_grammar_response_format_llama.py @@ -43,7 +43,10 @@ async def test_grammar_response_format_llama_json(llama_grammar, response_snapsh ], "seed": 42, "max_tokens": 500, - "response_format": {"type": "json_object", "value": Weather.model_json_schema()}, + "response_format": { + "type": "json_object", + "value": Weather.model_json_schema(), + }, } # send the request response = requests.post( @@ -75,7 +78,11 @@ async def test_grammar_response_format_llama_json(llama_grammar, response_snapsh json_payload["response_format"] = { "type": "json_schema", - "value": {"name": "weather", "strict": True, "schema": Weather.model_json_schema()}, + "value": { + "name": "weather", + "strict": True, + "schema": Weather.model_json_schema(), + }, } response = requests.post( f"{llama_grammar.base_url}/v1/chat/completions", @@ -119,7 +126,10 @@ async def test_grammar_response_format_llama_error_if_tools_not_installed( "seed": 42, "max_tokens": 500, "tools": [], - "response_format": {"type": "json_object", "value": Weather.model_json_schema()}, + "response_format": { + "type": "json_object", + "value": Weather.model_json_schema(), + }, }, ) diff --git a/server/text_generation_server/models/custom_modeling/idefics2.py b/server/text_generation_server/models/custom_modeling/idefics2.py index 5c0d2fcc..c891f4c8 100644 --- a/server/text_generation_server/models/custom_modeling/idefics2.py +++ b/server/text_generation_server/models/custom_modeling/idefics2.py @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" PyTorch Idefics2 model.""" +"""PyTorch Idefics2 model.""" from typing import List, Optional, Tuple diff --git a/server/text_generation_server/models/custom_modeling/idefics3.py b/server/text_generation_server/models/custom_modeling/idefics3.py index 6d303c2c..216b1eac 100644 --- a/server/text_generation_server/models/custom_modeling/idefics3.py +++ b/server/text_generation_server/models/custom_modeling/idefics3.py @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" PyTorch Idefics3 model.""" +"""PyTorch Idefics3 model.""" from typing import List, Optional, Tuple diff --git a/server/text_generation_server/models/custom_modeling/idefics_config.py b/server/text_generation_server/models/custom_modeling/idefics_config.py index a5565819..6ce2054e 100644 --- a/server/text_generation_server/models/custom_modeling/idefics_config.py +++ b/server/text_generation_server/models/custom_modeling/idefics_config.py @@ -17,7 +17,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Idefics model configuration""" +"""Idefics model configuration""" import copy from transformers import PretrainedConfig diff --git a/server/text_generation_server/models/custom_modeling/idefics_modeling.py b/server/text_generation_server/models/custom_modeling/idefics_modeling.py index 9fc9bca6..3104f742 100644 --- a/server/text_generation_server/models/custom_modeling/idefics_modeling.py +++ b/server/text_generation_server/models/custom_modeling/idefics_modeling.py @@ -17,7 +17,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" PyTorch Idefics model.""" +"""PyTorch Idefics model.""" from typing import List, Optional, Tuple, Union import torch diff --git a/server/text_generation_server/models/custom_modeling/idefics_vision.py b/server/text_generation_server/models/custom_modeling/idefics_vision.py index dd8f76bc..7d2051e0 100644 --- a/server/text_generation_server/models/custom_modeling/idefics_vision.py +++ b/server/text_generation_server/models/custom_modeling/idefics_vision.py @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" PyTorch IdeficsVision model: a copy of CLIPVisionModel using a simpler config object""" +"""PyTorch IdeficsVision model: a copy of CLIPVisionModel using a simpler config object""" from dataclasses import dataclass diff --git a/server/text_generation_server/models/custom_modeling/llava_next.py b/server/text_generation_server/models/custom_modeling/llava_next.py index 56a9565b..decee125 100644 --- a/server/text_generation_server/models/custom_modeling/llava_next.py +++ b/server/text_generation_server/models/custom_modeling/llava_next.py @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" PyTorch Llava-NeXT model.""" +"""PyTorch Llava-NeXT model.""" from typing import List, Optional, Tuple diff --git a/server/text_generation_server/models/custom_modeling/neox_modeling.py b/server/text_generation_server/models/custom_modeling/neox_modeling.py index 06731a6f..8554b632 100644 --- a/server/text_generation_server/models/custom_modeling/neox_modeling.py +++ b/server/text_generation_server/models/custom_modeling/neox_modeling.py @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" PyTorch GPTNeoX model.""" +"""PyTorch GPTNeoX model.""" from typing import Optional, Tuple, Union diff --git a/server/text_generation_server/models/custom_modeling/t5_modeling.py b/server/text_generation_server/models/custom_modeling/t5_modeling.py index e6666acd..0dce0f9e 100644 --- a/server/text_generation_server/models/custom_modeling/t5_modeling.py +++ b/server/text_generation_server/models/custom_modeling/t5_modeling.py @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" PyTorch T5 model.""" +"""PyTorch T5 model.""" import copy import math diff --git a/server/text_generation_server/utils/segments.py b/server/text_generation_server/utils/segments.py index fd8be563..3d880fec 100644 --- a/server/text_generation_server/utils/segments.py +++ b/server/text_generation_server/utils/segments.py @@ -9,7 +9,7 @@ import numpy as np def find_segments( - adapter_indices: Union[torch.Tensor, List[int]] + adapter_indices: Union[torch.Tensor, List[int]], ) -> Tuple[List[int], List[int]]: if isinstance(adapter_indices, torch.Tensor): adapter_indices = adapter_indices.cpu().numpy()