Merge pull request #1834 from BerriAI/litellm_sync_backup_model_info_with_root

[Feat] Sync model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json
This commit is contained in:
Ishaan Jaff 2024-02-05 15:08:49 -08:00 committed by GitHub
commit 5fc7041cf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1107 additions and 95 deletions

View file

@ -10,6 +10,12 @@ repos:
exclude: ^litellm/tests/|^litellm/proxy/proxy_cli.py|^litellm/integrations/|^litellm/proxy/tests/
additional_dependencies: [flake8-print]
files: litellm/.*\.py
- repo: local
hooks:
- id: check-files-match
name: Check if files match
entry: python3 ci_cd/check_files_match.py
language: system
- repo: local
hooks:
- id: mypy

View file

@ -0,0 +1,32 @@
import sys
import filecmp
import shutil
def main(argv=None):
print(
"Comparing model_prices_and_context_window and litellm/model_prices_and_context_window_backup.json files... checking if they match."
)
file1 = "model_prices_and_context_window.json"
file2 = "litellm/model_prices_and_context_window_backup.json"
cmp_result = filecmp.cmp(file1, file2, shallow=False)
if cmp_result:
print(f"Passed! Files {file1} and {file2} match.")
return 0
else:
print(
f"Failed! Files {file1} and {file2} do not match. Copying content from {file1} to {file2}."
)
copy_content(file1, file2)
return 1
def copy_content(source, destination):
shutil.copy2(source, destination)
if __name__ == "__main__":
sys.exit(main())

File diff suppressed because it is too large Load diff