Unverified Commit 0fcfc5cc authored by Sai-Suraj-27's avatar Sai-Suraj-27 Committed by GitHub
Browse files

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

Replaced deprecated mktemp function.
parent c38c55f4
......@@ -513,7 +513,7 @@ class LoadImageTester(unittest.TestCase):
def test_load_img_base64_prefix(self):
try:
tmp_file = tempfile.mktemp()
tmp_file = tempfile.NamedTemporaryFile(delete=False).name
with open(tmp_file, "wb") as f:
http_get(
"https://huggingface.co/datasets/hf-internal-testing/dummy-base64-images/raw/main/image_0.txt", f
......@@ -530,7 +530,7 @@ class LoadImageTester(unittest.TestCase):
def test_load_img_base64(self):
try:
tmp_file = tempfile.mktemp()
tmp_file = tempfile.NamedTemporaryFile(delete=False).name
with open(tmp_file, "wb") as f:
http_get(
"https://huggingface.co/datasets/hf-internal-testing/dummy-base64-images/raw/main/image_1.txt", f
......@@ -547,7 +547,7 @@ class LoadImageTester(unittest.TestCase):
def test_load_img_base64_encoded_bytes(self):
try:
tmp_file = tempfile.mktemp()
tmp_file = tempfile.NamedTemporaryFile(delete=False).name
with open(tmp_file, "wb") as f:
http_get(
"https://huggingface.co/datasets/hf-internal-testing/dummy-base64-images/raw/main/image_2.txt", f
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment