chore: remove dependency on llama_models completely (#1344)

This commit is contained in:
Ashwin Bharambe 2025-03-01 12:48:08 -08:00 committed by GitHub
parent 7131d5ddeb
commit 8bbd52bb9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 131358 additions and 202 deletions

View file

@ -0,0 +1,26 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# top-level folder for each specific model found within the models/ directory at
# the top-level of this source tree.
import collections
import torch
def get_negative_inf_value(dtype):
return torch.finfo(dtype).min
def to_2tuple(x):
if isinstance(x, collections.abc.Iterable):
return x
return (x, x)