mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-06-19 15:52:08 +00:00
Black
This commit is contained in:
parent
9dbaa176fd
commit
1acc96c82a
@ -12,7 +12,7 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
""" PyTorch Llava-NeXT model."""
|
"""PyTorch Llava-NeXT model."""
|
||||||
|
|
||||||
from typing import List, Optional, Tuple
|
from typing import List, Optional, Tuple
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
""" PyTorch Idefics2 model."""
|
"""PyTorch Idefics2 model."""
|
||||||
|
|
||||||
from typing import List, Optional, Tuple
|
from typing import List, Optional, Tuple
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
""" PyTorch Idefics3 model."""
|
"""PyTorch Idefics3 model."""
|
||||||
|
|
||||||
from typing import List, Optional, Tuple
|
from typing import List, Optional, Tuple
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
""" Idefics model configuration"""
|
"""Idefics model configuration"""
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
from transformers import PretrainedConfig
|
from transformers import PretrainedConfig
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
""" PyTorch Idefics model."""
|
"""PyTorch Idefics model."""
|
||||||
from typing import List, Optional, Tuple, Union
|
from typing import List, Optional, Tuple, Union
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# 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
|
from dataclasses import dataclass
|
||||||
|
@ -1798,7 +1798,9 @@ class FlashCausalLM(Model):
|
|||||||
total_batch_seq = 0.001
|
total_batch_seq = 0.001
|
||||||
total_mem = 0
|
total_mem = 0
|
||||||
available_mem = free_mem - self.mem_reserved
|
available_mem = free_mem - self.mem_reserved
|
||||||
log_master(logger.info, f"Decode batch size list:{[bsz[0] for bsz in buckets]}\n")
|
log_master(
|
||||||
|
logger.info, f"Decode batch size list:{[bsz[0] for bsz in buckets]}\n"
|
||||||
|
)
|
||||||
for i, (batch_size, block_num) in enumerate(buckets):
|
for i, (batch_size, block_num) in enumerate(buckets):
|
||||||
if batch_size > block_num:
|
if batch_size > block_num:
|
||||||
continue
|
continue
|
||||||
|
@ -822,7 +822,9 @@ class FlashVlmCausalLM(FlashCausalLM):
|
|||||||
total_batch_seq = 0.001
|
total_batch_seq = 0.001
|
||||||
total_mem = 0
|
total_mem = 0
|
||||||
available_mem = decode_available_memory
|
available_mem = decode_available_memory
|
||||||
log_master(logger.info, f"Decode batch size list:{[bsz[0] for bsz in buckets]}\n")
|
log_master(
|
||||||
|
logger.info, f"Decode batch size list:{[bsz[0] for bsz in buckets]}\n"
|
||||||
|
)
|
||||||
for i, (batch_size, block_num) in enumerate(buckets):
|
for i, (batch_size, block_num) in enumerate(buckets):
|
||||||
if batch_size > block_num:
|
if batch_size > block_num:
|
||||||
continue
|
continue
|
||||||
|
@ -442,7 +442,9 @@ class FlashMllamaCausalLM(FlashVlmCausalLM):
|
|||||||
total_batch_seq = 0.001
|
total_batch_seq = 0.001
|
||||||
total_mem = 0
|
total_mem = 0
|
||||||
available_mem = free_mem - self.mem_reserved
|
available_mem = free_mem - self.mem_reserved
|
||||||
log_master(logger.info, f"Decode batch size list:{[bsz[0] for bsz in buckets]}\n")
|
log_master(
|
||||||
|
logger.info, f"Decode batch size list:{[bsz[0] for bsz in buckets]}\n"
|
||||||
|
)
|
||||||
for i, (batch_size, block_num) in enumerate(buckets):
|
for i, (batch_size, block_num) in enumerate(buckets):
|
||||||
if batch_size > block_num:
|
if batch_size > block_num:
|
||||||
continue
|
continue
|
||||||
|
@ -8,7 +8,7 @@ import torch
|
|||||||
|
|
||||||
|
|
||||||
def find_segments(
|
def find_segments(
|
||||||
adapter_indices: Union[torch.Tensor, List[int]]
|
adapter_indices: Union[torch.Tensor, List[int]],
|
||||||
) -> Tuple[List[int], List[int]]:
|
) -> Tuple[List[int], List[int]]:
|
||||||
segments = [0]
|
segments = [0]
|
||||||
segment_indices = []
|
segment_indices = []
|
||||||
|
Loading…
Reference in New Issue
Block a user