forked from phoenix/litellm-mirror
(feat) pre-commit hook to validate
This commit is contained in:
parent
9cbc412c78
commit
a6836a0996
3 changed files with 34 additions and 2 deletions
|
@ -17,4 +17,11 @@ repos:
|
||||||
entry: python3 -m mypy --ignore-missing-imports
|
entry: python3 -m mypy --ignore-missing-imports
|
||||||
language: system
|
language: system
|
||||||
types: [python]
|
types: [python]
|
||||||
files: ^litellm/
|
files: ^litellm/
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: check-files-match
|
||||||
|
name: Check if files match
|
||||||
|
entry: python3 ci_cd/check_files_match.py
|
||||||
|
language: system
|
||||||
|
files: model_prices_and_context_window.json model_prices_and_context_window_backup.json
|
25
ci_cd/check_files_match.py
Normal file
25
ci_cd/check_files_match.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import sys
|
||||||
|
import filecmp
|
||||||
|
|
||||||
|
|
||||||
|
def main(argv=None):
|
||||||
|
if argv is None:
|
||||||
|
argv = sys.argv[1:]
|
||||||
|
|
||||||
|
if len(argv) != 2:
|
||||||
|
print("Usage: python check_files_match.py <file1> <file2>")
|
||||||
|
return 1
|
||||||
|
|
||||||
|
file1 = argv[0]
|
||||||
|
file2 = argv[1]
|
||||||
|
|
||||||
|
if filecmp.cmp(file1, file2, shallow=False):
|
||||||
|
print(f"Files {file1} and {file2} match.")
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
|
print(f"Files {file1} and {file2} do not match.")
|
||||||
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
|
@ -5,7 +5,7 @@
|
||||||
"max_output_tokens": 4096,
|
"max_output_tokens": 4096,
|
||||||
"input_cost_per_token": 0.00003,
|
"input_cost_per_token": 0.00003,
|
||||||
"output_cost_per_token": 0.00006,
|
"output_cost_per_token": 0.00006,
|
||||||
"litellm_provider": "openai",
|
"litellm_provider": "o",
|
||||||
"mode": "chat"
|
"mode": "chat"
|
||||||
},
|
},
|
||||||
"gpt-4-0314": {
|
"gpt-4-0314": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue