mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix: remove redundant import os, use Path().name instead
This commit is contained in:
parent
abe0c40c1a
commit
d7c2532137
1 changed files with 1 additions and 2 deletions
|
|
@ -5,7 +5,6 @@ Common utility functions used for translating messages across providers
|
|||
import io
|
||||
import mimetypes
|
||||
import re
|
||||
import os
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import (
|
||||
|
|
@ -647,7 +646,7 @@ def extract_file_data(file_data: FileTypes) -> ExtractedFileData:
|
|||
# If it's a file-like object
|
||||
# Try to get filename from file handle if not already set
|
||||
if not filename and hasattr(file_content, 'name'):
|
||||
filename = os.path.basename(file_content.name)
|
||||
filename = Path(file_content.name).name
|
||||
|
||||
content = file_content.read()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue