Skip to content

Commit 75460f0

Browse files
Merge pull request #729 from sergiopaniego/bin-to-safetensors
Updated .bin to .safetensors in 2. Using 🤗 Transformers - Models - Saving methods
2 parents 15cf873 + 1bf51f2 commit 75460f0

File tree

13 files changed

+27
-27
lines changed

13 files changed

+27
-27
lines changed

chapters/en/chapter2/3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ This will save two files to your disk:
4646
```
4747
ls directory_on_my_computer
4848
49-
config.json pytorch_model.bin
49+
config.json model.safetensors
5050
```
5151

5252
If you look inside the *config.json* file, you'll see all the necessary attributes needed to build the model architecture. This file also contains some metadata, such as where the checkpoint originated and what 🤗 Transformers version you were using when you last saved the checkpoint.
5353

54-
The *pytorch_model.bin* file is known as the state dictionary; it contains all your model's weights. The two files work together: the configuration file is needed to know about the model architecture, while the model weights are the parameters of the model.
54+
The *pytorch_model.safetensors* file is known as the state dictionary; it contains all your model's weights. The two files work together: the configuration file is needed to know about the model architecture, while the model weights are the parameters of the model.
5555

5656
To reuse a saved model, use the `from_pretrained()` method again:
5757

chapters/fa/chapter2/3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ model.save_pretrained("directory_on_my_computer")
188188
```
189189
ls directory_on_my_computer
190190
191-
config.json pytorch_model.bin
191+
config.json model.safetensors
192192
```
193193
{:else}
194194
```
@@ -204,7 +204,7 @@ config.json tf_model.h5
204204

205205
{#if fw === 'pt'}
206206

207-
فایل *pytorch_model.bin* در واقع *دیکشنری وضعیت‌ها* است و حاوی تمام وزن‌های مدل شماست. این دو فایل به همراه هم کاربرد دارند؛ فایل تنظیمات برای دانستن معماری به کار رفته در مدل ضروری است و پارامترهای مدل هم که همان وزن‌های داخل فایل دوم هستند.
207+
فایل *model.safetensors* در واقع *دیکشنری وضعیت‌ها* است و حاوی تمام وزن‌های مدل شماست. این دو فایل به همراه هم کاربرد دارند؛ فایل تنظیمات برای دانستن معماری به کار رفته در مدل ضروری است و پارامترهای مدل هم که همان وزن‌های داخل فایل دوم هستند.
208208

209209
{:else}
210210

chapters/fr/chapter2/3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Cela enregistre deux fichiers sur votre disque :
164164
```
165165
ls directory_on_my_computer
166166
167-
config.json pytorch_model.bin
167+
config.json model.safetensors
168168
```
169169
{:else}
170170
```
@@ -177,7 +177,7 @@ config.json tf_model.h5
177177
Si vous jetez un coup d'œil au fichier *config.json*, vous reconnaîtrez les attributs nécessaires pour construire l'architecture du modèle. Ce fichier contient également certaines métadonnées, comme l'origine du *checkpoint* et la version de la bibliothèque 🤗 *Transformers* que vous utilisiez lors du dernier enregistrement du point *checkpoint*.
178178

179179
{#if fw === 'pt'}
180-
Le fichier *pytorch_model.bin* est connu comme le *dictionnaire d'état*. Il contient tous les poids de votre modèle. Les deux fichiers vont de pair : la configuration est nécessaire pour connaître l'architecture de votre modèle, tandis que les poids du modèle sont les paramètres de votre modèle.
180+
Le fichier *model.safetensors* est connu comme le *dictionnaire d'état*. Il contient tous les poids de votre modèle. Les deux fichiers vont de pair : la configuration est nécessaire pour connaître l'architecture de votre modèle, tandis que les poids du modèle sont les paramètres de votre modèle.
181181

182182
{:else}
183183
Le fichier *tf_model.h5* est connu comme le *dictionnaire d'état*. Il contient tous les poids de votre modèle. Les deux fichiers vont de pair : la configuration est nécessaire pour connaître l'architecture de votre modèle, tandis que les poids du modèle sont les paramètres de votre modèle.

chapters/it/chapter2/3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ In questo modo si salvano due file sul disco:
160160
```
161161
ls directory_on_my_computer
162162
163-
config.json pytorch_model.bin
163+
config.json model.safetensors
164164
```
165165
{:else}
166166
```
@@ -174,7 +174,7 @@ Se si dà un'occhiata al file *config.json*, si riconoscono gli attributi necess
174174

175175
{#if fw === 'pt'}
176176

177-
Il file *pytorch_model.bin* è noto come *state dictionary*; contiene tutti i pesi del modello. I due file vanno di pari passo: la configurazione è necessaria per conoscere l'architettura del modello, mentre i pesi del modello sono i suoi parametri.
177+
Il file *model.safetensors* è noto come *state dictionary*; contiene tutti i pesi del modello. I due file vanno di pari passo: la configurazione è necessaria per conoscere l'architettura del modello, mentre i pesi del modello sono i suoi parametri.
178178

179179
{:else}
180180

chapters/ja/chapter2/3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ model.save_pretrained("directory_on_my_computer")
160160
```
161161
ls directory_on_my_computer
162162
163-
config.json pytorch_model.bin
163+
config.json model.safetensors
164164
```
165165
{:else}
166166
```
@@ -173,7 +173,7 @@ config.json tf_model.h5
173173
*config.json* ファイルを見てみると、モデルアーキテクチャを構築するために必要な属性がわかると思います。このファイルには、チェックポイントがどこで発生したのか、最後にチェックポイントを保存したときに使用していた🤗 Transformersのバージョンなどのメタデータも含まれています。
174174

175175
{#if fw === 'pt'}
176-
*pytorch_model.bin* ファイルは *state dictionary* として知られており、モデルのすべての重みが含まれています。この2つのファイルは密接に関係しています。コンフィギュレーションはモデルのアーキテクチャを知るために必要であり、モデルの重みはモデルのパラメータです。
176+
*model.safetensors* ファイルは *state dictionary* として知られており、モデルのすべての重みが含まれています。この2つのファイルは密接に関係しています。コンフィギュレーションはモデルのアーキテクチャを知るために必要であり、モデルの重みはモデルのパラメータです。
177177

178178
{:else}
179179
*tf_model.h5*ファイルは*state dictionary*として知られており、すべてのモデルの重みが含まれています。この2つのファイルは密接に関係しています。設定はモデルのアーキテクチャを知るために必要であり、モデルの重みはモデルのパラメータです。

chapters/ko/chapter2/3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ model.save_pretrained("directory_on_my_computer")
161161
```
162162
ls directory_on_my_computer
163163
164-
config.json pytorch_model.bin
164+
config.json model.safetensors
165165
```
166166
{:else}
167167
```
@@ -174,7 +174,7 @@ config.json tf_model.h5
174174
*config.json* 파일은 모델 아키텍처를 구축하는 데 필요한 속성을 알려줍니다. 이 파일에는 체크포인트가 어디에서 생성되었는지, 마지막으로 체크포인트를 저장할 때 사용한 🤗 Transformers 버전 등의 메타데이터도 포함되어 있습니다.
175175

176176
{#if fw === 'pt'}
177-
The *pytorch_model.bin* file is known as the *state dictionary*; it contains all your model's weights. The two files go hand in hand; the configuration is necessary to know your model's architecture, while the model weights are your model's parameters.
177+
The *model.safetensors* file is known as the *state dictionary*; it contains all your model's weights. The two files go hand in hand; the configuration is necessary to know your model's architecture, while the model weights are your model's parameters.
178178

179179
{:else}
180180
The *tf_model.h5* file is known as the *state dictionary*; it contains all your model's weights. The two files go hand in hand; the configuration is necessary to know your model's architecture, while the model weights are your model's parameters.

chapters/pt/chapter2/3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Isto salva dois arquivos em seu disco:
160160
```
161161
ls path_no_seu_computador
162162
163-
config.json pytorch_model.bin
163+
config.json model.safetensors
164164
```
165165
{:else}
166166
```
@@ -173,7 +173,7 @@ config.json tf_model.h5
173173
Se você der uma olhada no arquivo *config.json*, você reconhecerá os atributos necessários para construir a arquitetura modelo. Este arquivo também contém alguns metadados, como a origem do checkpoint e a versão 🤗 Transformers que você estava usando quando salvou o checkpoint pela última vez.
174174

175175
{#if fw === 'pt'}
176-
O arquivo *pytorch_model.bin* é conhecido como o *dicionário de estado*; ele contém todos os pesos do seu modelo. Os dois arquivos andam de mãos dadas; a configuração é necessária para conhecer a arquitetura de seu modelo, enquanto os pesos do modelo são os parâmetros de seu modelo.
176+
O arquivo *model.safetensors* é conhecido como o *dicionário de estado*; ele contém todos os pesos do seu modelo. Os dois arquivos andam de mãos dadas; a configuração é necessária para conhecer a arquitetura de seu modelo, enquanto os pesos do modelo são os parâmetros de seu modelo.
177177

178178
{:else}
179179
O arquivo *tf_model.h5* é conhecido como o *dicionário de estado*; ele contém todos os pesos do seu modelo. Os dois arquivos andam de mãos dadas; a configuração é necessária para conhecer a arquitetura de seu modelo, enquanto os pesos do modelo são os parâmetros de seu modelo.

chapters/ru/chapter2/3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ model.save_pretrained("directory_on_my_computer")
158158
```
159159
ls directory_on_my_computer
160160
161-
config.json pytorch_model.bin
161+
config.json model.safetensors
162162
```
163163
{:else}
164164
```
@@ -171,7 +171,7 @@ config.json tf_model.h5
171171
Если вы посмотрите на файл *config.json*, то узнаете атрибуты, необходимые для построения архитектуры модели. Этот файл также содержит некоторые метаданные, такие как место создания контрольной точки и версию 🤗 Transformers, которую вы использовали при последнем сохранении контрольной точки.
172172

173173
{#if fw === 'pt'}
174-
Файл *pytorch_model.bin* известен как *словарь состояний (state dictionary)*; он содержит все веса вашей модели. Эти два файла неразрывно связаны друг с другом; конфигурация необходима для того, чтобы знать архитектуру модели, а веса модели - это ее параметры.
174+
Файл *model.safetensors* известен как *словарь состояний (state dictionary)*; он содержит все веса вашей модели. Эти два файла неразрывно связаны друг с другом; конфигурация необходима для того, чтобы знать архитектуру модели, а веса модели - это ее параметры.
175175

176176
{:else}
177177
Файл *tf_model.h5* известен как *словарь состояний (state dictionary)*; он содержит все веса вашей модели. Эти два файла неразрывно связаны друг с другом; конфигурация необходима для того, чтобы знать архитектуру модели, а веса модели - это ее параметры.

chapters/rum/chapter2/3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Se salvează două fișiere pe disc:
162162
```
163163
ls directory_on_my_computer
164164
165-
config.json pytorch_model.bin
165+
config.json pytorch_model.safetensors
166166
```
167167
{:else}
168168
```
@@ -176,7 +176,7 @@ Dacă aruncați o privire la fișierul *config.json*, veți recunoaște atribute
176176

177177
{#if fw === 'pt'}
178178

179-
Fișierul *pytorch_model.bin* este cunoscut sub numele de *state dictionary*; acesta conține toate weight-urile modelului dumneavoastră. Cele două fișiere merg mână în mână; configurația este necesară pentru a cunoaște arhitectura modelului, în timp ce weight-urile modelului sunt parametrii modelului.
179+
Fișierul *pytorch_model.safetensors* este cunoscut sub numele de *state dictionary*; acesta conține toate weight-urile modelului dumneavoastră. Cele două fișiere merg mână în mână; configurația este necesară pentru a cunoaște arhitectura modelului, în timp ce weight-urile modelului sunt parametrii modelului.
180180

181181
{:else}
182182

chapters/th/chapter2/3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ model.save_pretrained("directory_on_my_computer")
158158
```
159159
ls directory_on_my_computer
160160
161-
config.json pytorch_model.bin
161+
config.json model.safetensors
162162
```
163163
{:else}
164164
```
@@ -171,7 +171,7 @@ config.json tf_model.h5
171171
ุุ้ถ้าคุณไปดูที่ไฟล์ *config.json* คุณจะพอนึกออกถึงคุณสมบัติ(attributes) ที่จำเป็นในการสร้างสถาปัตยกรรมของโมเดล ไฟล์นี้ประกอบด้วย metadata เช่น checkpoint เกิดมาจากที่ใด และ 🤗 Transformers เวอร์ชันใดที่คุณใช้ในการบันทึก checkpoint ล่าสุด
172172

173173
{#if fw === 'pt'}
174-
ไฟล์ *pytorch_model.bin* เป็นที่รู้จักในนาม *state dictionary*; มันประกอบด้วย weights ทัั้งหมดของโมเดลคุณ สองไฟล์ที่มีความเชื่อมโยงกัน ไฟล์ configuration จำเป็นที่จะต้องรู้สถาปัตยกรรมของโมเดลของคุณ ในขณะที่ weights ของโมเดลคุณ ก็คือ ตัวแปร(parameters) ของโมเดลคุณ
174+
ไฟล์ *model.safetensors* เป็นที่รู้จักในนาม *state dictionary*; มันประกอบด้วย weights ทัั้งหมดของโมเดลคุณ สองไฟล์ที่มีความเชื่อมโยงกัน ไฟล์ configuration จำเป็นที่จะต้องรู้สถาปัตยกรรมของโมเดลของคุณ ในขณะที่ weights ของโมเดลคุณ ก็คือ ตัวแปร(parameters) ของโมเดลคุณ
175175

176176
{:else}
177177
ไฟล์ *tf_model.h5* เป็นที่รู้จักในนาม *state dictionary*; มันประกอบด้วย weights ทัั้งหมดของโมเดลคุณ สองไฟล์ที่มีความเชื่อมโยงกัน ไฟล์ configuration จำเป็นที่จะต้องรู้สถาปัตยกรรมของโมเดลของคุณ ในขณะที่ weights ของโมเดลคุณ ก็คือ ตัวแปร(parameters) ของโมเดลคุณ

0 commit comments

Comments
 (0)