fix: Replaced deprecated mktemp() function (#32123)

Replaced deprecated mktemp function.
This commit is contained in:
Sai-Suraj-27
2024-07-22 18:43:39 +05:30
committed by GitHub
parent c38c55f4fb
commit 0fcfc5ccc9
2 changed files with 4 additions and 4 deletions

View File

@@ -84,7 +84,7 @@ class TokenizerUtilTester(unittest.TestCase):
def test_legacy_load_from_one_file(self):
# This test is for deprecated behavior and can be removed in v5
try:
tmp_file = tempfile.mktemp()
tmp_file = tempfile.NamedTemporaryFile(delete=False).name
with open(tmp_file, "wb") as f:
http_get("https://huggingface.co/albert/albert-base-v1/resolve/main/spiece.model", f)