<p dir="auto"><strong>System information</strong>.</p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in Keras): No</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): glinux 5.17.11-1rodete2-amd64</li>
<li>TensorFlow installed from (source or binary): binary</li>
<li>TensorFlow version (use command below): 2.9.1</li>
<li>Python version: 3.10.0</li>
<li>Bazel version (if compiling from source): n/a</li>
<li>GPU model and memory: n/a</li>
<li>Exact command to reproduce:</li>
</ul>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="gzip_path = &quot;https://storage.googleapis.com/tf_model_garden/nlp/bert/v3/uncased_L-12_H-768_A-12.tar.gz&quot;
# `/content/bert_base_uncased` is still a `tar.gz` file
ungzip_file = keras.utils.get_file(
    &quot;/content/bert_base_uncased&quot;,
    gzip_path,
    extract=True,
    archive_format=&quot;tar&quot;, # bug occurs whether this arg is specified
)"><pre class="notranslate"><span class="pl-s1">gzip_path</span> <span class="pl-c1">=</span> <span class="pl-s">"https://storage.googleapis.com/tf_model_garden/nlp/bert/v3/uncased_L-12_H-768_A-12.tar.gz"</span>
<span class="pl-c"># `/content/bert_base_uncased` is still a `tar.gz` file</span>
<span class="pl-s1">ungzip_file</span> <span class="pl-c1">=</span> <span class="pl-s1">keras</span>.<span class="pl-s1">utils</span>.<span class="pl-en">get_file</span>(
    <span class="pl-s">"/content/bert_base_uncased"</span>,
    <span class="pl-s1">gzip_path</span>,
    <span class="pl-s1">extract</span><span class="pl-c1">=</span><span class="pl-c1">True</span>,
    <span class="pl-s1">archive_format</span><span class="pl-c1">=</span><span class="pl-s">"tar"</span>, <span class="pl-c"># bug occurs whether this arg is specified</span>
)</pre></div>
<p dir="auto"><strong>Describe the problem</strong>.</p>
<p dir="auto"><code class="notranslate">get_file</code> documentation claims to support <code class="notranslate">gzip</code> in the <code class="notranslate">archive_format</code> argument docstring (see <a href="https://www.tensorflow.org/api_docs/python/tf/keras/utils/get_file" rel="nofollow">https://www.tensorflow.org/api_docs/python/tf/keras/utils/get_file</a>). However, I have tried several <code class="notranslate">tar.gz</code> files like the example above and they are not extracted.</p>
<p dir="auto"><strong>Describe the current behavior</strong>.<br>
<code class="notranslate">tar.gz</code> files are downloaded but not extracted.</p>
<p dir="auto"><strong>Describe the expected behavior</strong>.<br>
<code class="notranslate">tar.gz</code> files are downloaded and extracted. <code class="notranslate">bert_base_uncased</code> should be a folder with the following files:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="tmp/temp_dir/raw/
tmp/temp_dir/raw/vocab.txt
tmp/temp_dir/raw/bert_model.ckpt.index
tmp/temp_dir/raw/bert_model.ckpt.data-00000-of-00001
tmp/temp_dir/raw/bert_config.json"><pre class="notranslate"><code class="notranslate">tmp/temp_dir/raw/
tmp/temp_dir/raw/vocab.txt
tmp/temp_dir/raw/bert_model.ckpt.index
tmp/temp_dir/raw/bert_model.ckpt.data-00000-of-00001
tmp/temp_dir/raw/bert_config.json
</code></pre></div>
<p dir="auto"><strong><a href="https://github.com/keras-team/keras/blob/master/CONTRIBUTING.md">Contributing</a></strong>.</p>
<ul dir="auto">
<li>Do you want to contribute a PR? (yes/no):<br>
No</li>
</ul>
<p dir="auto"><strong>Standalone code to reproduce the issue</strong>.<br>
Please see <a href="https://colab.research.google.com/drive/1OcIuIcii7CFhNudp9rIvNWNqU-VZg9SI?usp=sharing" rel="nofollow">https://colab.research.google.com/drive/1OcIuIcii7CFhNudp9rIvNWNqU-VZg9SI?usp=sharing</a></p>
<p dir="auto"><strong>Source code / logs</strong>.<br>
n/a see colab</p>
<p dir="auto"><strong>System information</strong>.</p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in Keras): No</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): glinux 5.17.11-1rodete2-amd64</li>
<li>TensorFlow installed from (source or binary): binary</li>
<li>TensorFlow version (use command below): 2.9.1</li>
<li>Python version: 3.10.0</li>
<li>Bazel version (if compiling from source): n/a</li>
<li>GPU model and memory: n/a</li>
<li>Exact command to reproduce:</li>
</ul>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="gzip_path = &quot;https://storage.googleapis.com/tf_model_garden/nlp/bert/v3/uncased_L-12_H-768_A-12.tar.gz&quot;
# `/content/bert_base_uncased` is still a `tar.gz` file
ungzip_file = keras.utils.get_file(
    &quot;/content/bert_base_uncased&quot;,
    gzip_path,
    extract=True,
    archive_format=&quot;tar&quot;, # bug occurs whether this arg is specified
)"><pre class="notranslate"><span class="pl-s1">gzip_path</span> <span class="pl-c1">=</span> <span class="pl-s">"https://storage.googleapis.com/tf_model_garden/nlp/bert/v3/uncased_L-12_H-768_A-12.tar.gz"</span>
<span class="pl-c"># `/content/bert_base_uncased` is still a `tar.gz` file</span>
<span class="pl-s1">ungzip_file</span> <span class="pl-c1">=</span> <span class="pl-s1">keras</span>.<span class="pl-s1">utils</span>.<span class="pl-en">get_file</span>(
    <span class="pl-s">"/content/bert_base_uncased"</span>,
    <span class="pl-s1">gzip_path</span>,
    <span class="pl-s1">extract</span><span class="pl-c1">=</span><span class="pl-c1">True</span>,
    <span class="pl-s1">archive_format</span><span class="pl-c1">=</span><span class="pl-s">"tar"</span>, <span class="pl-c"># bug occurs whether this arg is specified</span>
)</pre></div>
<p dir="auto"><strong>Describe the problem</strong>.</p>
<p dir="auto"><code class="notranslate">get_file</code> documentation claims to support <code class="notranslate">gzip</code> in the <code class="notranslate">archive_format</code> argument docstring (see <a href="https://www.tensorflow.org/api_docs/python/tf/keras/utils/get_file" rel="nofollow">https://www.tensorflow.org/api_docs/python/tf/keras/utils/get_file</a>). However, I have tried several <code class="notranslate">tar.gz</code> files like the example above and they are not extracted.</p>
<p dir="auto"><strong>Describe the current behavior</strong>.<br>
<code class="notranslate">tar.gz</code> files are downloaded but not extracted.</p>
<p dir="auto"><strong>Describe the expected behavior</strong>.<br>
<code class="notranslate">tar.gz</code> files are downloaded and extracted. <code class="notranslate">bert_base_uncased</code> should be a folder with the following files:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="tmp/temp_dir/raw/
tmp/temp_dir/raw/vocab.txt
tmp/temp_dir/raw/bert_model.ckpt.index
tmp/temp_dir/raw/bert_model.ckpt.data-00000-of-00001
tmp/temp_dir/raw/bert_config.json"><pre class="notranslate"><code class="notranslate">tmp/temp_dir/raw/
tmp/temp_dir/raw/vocab.txt
tmp/temp_dir/raw/bert_model.ckpt.index
tmp/temp_dir/raw/bert_model.ckpt.data-00000-of-00001
tmp/temp_dir/raw/bert_config.json
</code></pre></div>
<p dir="auto"><strong><a href="https://github.com/keras-team/keras/blob/master/CONTRIBUTING.md">Contributing</a></strong>.</p>
<ul dir="auto">
<li>Do you want to contribute a PR? (yes/no):<br>
No</li>
</ul>
<p dir="auto"><strong>Standalone code to reproduce the issue</strong>.<br>
Please see <a href="https://colab.research.google.com/drive/1OcIuIcii7CFhNudp9rIvNWNqU-VZg9SI?usp=sharing" rel="nofollow">https://colab.research.google.com/drive/1OcIuIcii7CFhNudp9rIvNWNqU-VZg9SI?usp=sharing</a></p>
<p dir="auto"><strong>Source code / logs</strong>.<br>
n/a see colab</p>