mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
fix(harness): support bounded provenance hashing on Python 3.10
This commit is contained in:
parent
75ae4d591a
commit
878f0da9ab
1 changed files with 4 additions and 1 deletions
|
|
@ -17,8 +17,11 @@ from .models import Invocation, Ready, Timing
|
|||
|
||||
|
||||
def file_sha256(path: Path) -> str:
|
||||
digest: Final = hashlib.sha256()
|
||||
with path.open("rb") as source:
|
||||
return hashlib.file_digest(source, "sha256").hexdigest()
|
||||
for chunk in iter(lambda: source.read(256 * 1024), b""):
|
||||
digest.update(chunk)
|
||||
return digest.hexdigest()
|
||||
|
||||
|
||||
def _ready(response: OCRResponse) -> Ready:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue