Bump transformers from 3.5.1 to 4.38.0 in /examples/research_projects/adversarial
Author: dependabot[bot]
Pull request: yes
Labels: name: dependencies

name: python

Bumps [transformers](https://github.com/huggingface/transformers) from 3.5.1 to 4.38.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/huggingface/transformers/releases">transformers's releases</a>.</em></p>
<blockquote>
<h2>v4.38: Gemma, Depth Anything, Stable LM; Static Cache, HF Quantizer, AQLM</h2>
<h2>New model additions</h2>
<h3>💎 Gemma 💎</h3>
<p>Gemma is a new opensource Language Model series from Google AI that comes with a 2B and 7B variant. The release comes with the pre-trained and instruction fine-tuned versions and you can use them via <code>AutoModelForCausalLM</code>, <code>GemmaForCausalLM</code> or <code>pipeline</code> interface!</p>
<p>Read more about it in the Gemma release blogpost: <a href="https://hf.co/blog/gemma">https://hf.co/blog/gemma</a></p>
<pre lang="python"><code>from transformers import AutoTokenizer, AutoModelForCausalLM
<p>tokenizer = AutoTokenizer.from_pretrained(&quot;google/gemma-2b&quot;)
model = AutoModelForCausalLM.from_pretrained(&quot;google/gemma-2b&quot;, device_map=&quot;auto&quot;, torch_dtype=torch.float16)</p>
<p>input_text = &quot;Write me a poem about Machine Learning.&quot;
input_ids = tokenizer(input_text, return_tensors=&quot;pt&quot;).to(&quot;cuda&quot;)</p>
<p>outputs = model.generate(**input_ids)
</code></pre></p>
<p>You can use the model with Flash Attention, SDPA, Static cache and quantization API for further optimizations !</p>
<ul>
<li>Flash Attention 2</li>
</ul>
<pre lang="python"><code>from transformers import AutoTokenizer, AutoModelForCausalLM
<p>tokenizer = AutoTokenizer.from_pretrained(&quot;google/gemma-2b&quot;)</p>
<p>model = AutoModelForCausalLM.from_pretrained(
&quot;google/gemma-2b&quot;, device_map=&quot;auto&quot;, torch_dtype=torch.float16, attn_implementation=&quot;flash_attention_2&quot;
)</p>
<p>input_text = &quot;Write me a poem about Machine Learning.&quot;
input_ids = tokenizer(input_text, return_tensors=&quot;pt&quot;).to(&quot;cuda&quot;)</p>
<p>outputs = model.generate(**input_ids)
</code></pre></p>
<ul>
<li>bitsandbytes-4bit</li>
</ul>
<pre lang="python"><code>from transformers import AutoTokenizer, AutoModelForCausalLM
<p>tokenizer = AutoTokenizer.from_pretrained(&quot;google/gemma-2b&quot;)</p>
<p>model = AutoModelForCausalLM.from_pretrained(
&quot;google/gemma-2b&quot;, device_map=&quot;auto&quot;, load_in_4bit=True
)
&lt;/tr&gt;&lt;/table&gt;
</code></pre></p>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/huggingface/transformers/commit/08ab54ada594f8f4cc1e458b1217bf8c53f04dd8"><code>08ab54a</code></a> [ <code>gemma</code>] Adds support for Gemma 💎 (<a href="https://redirect.github.com/huggingface/transformers/issues/29167">#29167</a>)</li>
<li><a href="https://github.com/huggingface/transformers/commit/2de9314197a12e134f3fff2710f6d86e97b774a3"><code>2de9314</code></a> [<code>Maskformer</code>] safely get backbone config (<a href="https://redirect.github.com/huggingface/transformers/issues/29166">#29166</a>)</li>
<li><a href="https://github.com/huggingface/transformers/commit/476957b5b471fe8a3be9968485118c67a739a044"><code>476957b</code></a> 🚨 Llama: update rope scaling to match static cache changes (<a href="https://redirect.github.com/huggingface/transformers/issues/29143">#29143</a>)</li>
<li><a href="https://github.com/huggingface/transformers/commit/7a4bec6e8f6f81f47228092b9f6b9b7e2b55ebe7"><code>7a4bec6</code></a> Release: 4.38.0</li>
<li><a href="https://github.com/huggingface/transformers/commit/ee3af60be0d21044692211d97dfd858aa3e4b418"><code>ee3af60</code></a> Add support for fine-tuning CLIP-like models using contrastive-image-text exa...</li>
<li><a href="https://github.com/huggingface/transformers/commit/0996a10077219de0556281511fc02f3ab68002d5"><code>0996a10</code></a> Revert low cpu mem tie weights (<a href="https://redirect.github.com/huggingface/transformers/issues/29135">#29135</a>)</li>
<li><a href="https://github.com/huggingface/transformers/commit/15cfe38942e4012f5476e7f45dfacf26791b0ccc"><code>15cfe38</code></a> [<code>Core tokenization</code>]  <code>add_dummy_prefix_space</code> option to help with latest is...</li>
<li><a href="https://github.com/huggingface/transformers/commit/efdd436663436e78d8ad3213d11325d86578db95"><code>efdd436</code></a> FIX [<code>PEFT</code> / <code>Trainer</code> ] Handle better peft + quantized compiled models (<a href="https://redirect.github.com/huggingface/transformers/issues/29">#29</a>...</li>
<li><a href="https://github.com/huggingface/transformers/commit/5e95dcabe1d3d522a8bc5a45990c53d9d4e9f2eb"><code>5e95dca</code></a> [<code>cuda kernels</code>] only compile them when initializing (<a href="https://redirect.github.com/huggingface/transformers/issues/29133">#29133</a>)</li>
<li><a href="https://github.com/huggingface/transformers/commit/a7755d24096306c84a3557394b54a95db7a0f76f"><code>a7755d2</code></a> Generate: unset GenerationConfig parameters do not raise warning (<a href="https://redirect.github.com/huggingface/transformers/issues/29119">#29119</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/huggingface/transformers/compare/v3.5.1...v4.38.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=transformers&package-manager=pip&previous-version=3.5.1&new-version=4.38.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/huggingface/transformers/network/alerts).

</details>

Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_31320). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.