Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated .bin to .safetensors in 2. Using 🤗 Transformers - Models - Saving methods #729

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chapters/en/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ This saves two files to your disk:
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -171,7 +171,7 @@ config.json tf_model.h5
If you take a look at the *config.json* file, you'll recognize the attributes necessary 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.

{#if fw === 'pt'}
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.
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.

{:else}
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.
Expand Down
4 changes: 2 additions & 2 deletions chapters/fa/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ model.save_pretrained("directory_on_my_computer")
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -204,7 +204,7 @@ config.json tf_model.h5

{#if fw === 'pt'}

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

{:else}

Expand Down
4 changes: 2 additions & 2 deletions chapters/fr/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Cela enregistre deux fichiers sur votre disque :
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -177,7 +177,7 @@ config.json tf_model.h5
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*.

{#if fw === 'pt'}
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.
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.

{:else}
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.
Expand Down
4 changes: 2 additions & 2 deletions chapters/it/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ In questo modo si salvano due file sul disco:
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -174,7 +174,7 @@ Se si dà un'occhiata al file *config.json*, si riconoscono gli attributi necess

{#if fw === 'pt'}

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.
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.

{:else}

Expand Down
4 changes: 2 additions & 2 deletions chapters/ja/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ model.save_pretrained("directory_on_my_computer")
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -173,7 +173,7 @@ config.json tf_model.h5
*config.json* ファイルを見てみると、モデルアーキテクチャを構築するために必要な属性がわかると思います。このファイルには、チェックポイントがどこで発生したのか、最後にチェックポイントを保存したときに使用していた🤗 Transformersのバージョンなどのメタデータも含まれています。

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

{:else}
*tf_model.h5*ファイルは*state dictionary*として知られており、すべてのモデルの重みが含まれています。この2つのファイルは密接に関係しています。設定はモデルのアーキテクチャを知るために必要であり、モデルの重みはモデルのパラメータです。
Expand Down
4 changes: 2 additions & 2 deletions chapters/ko/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ model.save_pretrained("directory_on_my_computer")
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -174,7 +174,7 @@ config.json tf_model.h5
*config.json* 파일은 모델 아키텍처를 구축하는 데 필요한 속성을 알려줍니다. 이 파일에는 체크포인트가 어디에서 생성되었는지, 마지막으로 체크포인트를 저장할 때 사용한 🤗 Transformers 버전 등의 메타데이터도 포함되어 있습니다.

{#if fw === 'pt'}
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.
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.

{:else}
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.
Expand Down
4 changes: 2 additions & 2 deletions chapters/pt/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Isto salva dois arquivos em seu disco:
```
ls path_no_seu_computador

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -173,7 +173,7 @@ config.json tf_model.h5
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.

{#if fw === 'pt'}
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.
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.

{:else}
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.
Expand Down
4 changes: 2 additions & 2 deletions chapters/ru/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ model.save_pretrained("directory_on_my_computer")
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -171,7 +171,7 @@ config.json tf_model.h5
Если вы посмотрите на файл *config.json*, то узнаете атрибуты, необходимые для построения архитектуры модели. Этот файл также содержит некоторые метаданные, такие как место создания контрольной точки и версию 🤗 Transformers, которую вы использовали при последнем сохранении контрольной точки.

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

{:else}
Файл *tf_model.h5* известен как *словарь состояний (state dictionary)*; он содержит все веса вашей модели. Эти два файла неразрывно связаны друг с другом; конфигурация необходима для того, чтобы знать архитектуру модели, а веса модели - это ее параметры.
Expand Down
4 changes: 2 additions & 2 deletions chapters/th/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ model.save_pretrained("directory_on_my_computer")
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -171,7 +171,7 @@ config.json tf_model.h5
ุุ้ถ้าคุณไปดูที่ไฟล์ *config.json* คุณจะพอนึกออกถึงคุณสมบัติ(attributes) ที่จำเป็นในการสร้างสถาปัตยกรรมของโมเดล ไฟล์นี้ประกอบด้วย metadata เช่น checkpoint เกิดมาจากที่ใด และ 🤗 Transformers เวอร์ชันใดที่คุณใช้ในการบันทึก checkpoint ล่าสุด

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

{:else}
ไฟล์ *tf_model.h5* เป็นที่รู้จักในนาม *state dictionary*; มันประกอบด้วย weights ทัั้งหมดของโมเดลคุณ สองไฟล์ที่มีความเชื่อมโยงกัน ไฟล์ configuration จำเป็นที่จะต้องรู้สถาปัตยกรรมของโมเดลของคุณ ในขณะที่ weights ของโมเดลคุณ ก็คือ ตัวแปร(parameters) ของโมเดลคุณ
Expand Down
4 changes: 2 additions & 2 deletions chapters/vi/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Thao tác này sẽ lưu hai tệp vào đĩa của bạn:
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```

{:else}
Expand All @@ -204,7 +204,7 @@ Nếu bạn xem tệp _config.json_, bạn sẽ nhận ra các thuộc tính c

{#if fw === 'pt'}

Tệp _pytorch_model.bin_ được gọi là _state dictionary_ (_từ điển trạng thái_); nó chứa tất cả các trọng số mô hình của bạn. Hai tập tin đi đôi với nhau; cấu hình là cần thiết để biết kiến trúc mô hình của bạn, trong khi trọng số mô hình là thông số của mô hình của bạn.
Tệp _model.safetensors_ được gọi là _state dictionary_ (_từ điển trạng thái_); nó chứa tất cả các trọng số mô hình của bạn. Hai tập tin đi đôi với nhau; cấu hình là cần thiết để biết kiến trúc mô hình của bạn, trong khi trọng số mô hình là thông số của mô hình của bạn.

{:else}

Expand Down
4 changes: 2 additions & 2 deletions chapters/zh-CN/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ model.save_pretrained("directory_on_my_computer")
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -197,7 +197,7 @@ config.json
文件,您将识别构建模型体系结构所需的属性。该文件还包含一些元数据,例如*checkpoint*的来源以及上次保存检查点时使用的🤗 Transformers版本。

{#if fw === 'pt'}
这个 *pytorch_model.bin* 文件就是众所周知的*state dictionary*; 它包含模型的所有权重。这两个文件密切相关;这个配置是了解您的模型架构所必需的,而模型权重则是您模型的参数。
这个 *model.safetensors* 文件就是众所周知的*state dictionary*; 它包含模型的所有权重。这两个文件密切相关;这个配置是了解您的模型架构所必需的,而模型权重则是您模型的参数。

{:else}
这个 *tf_model.h5* 文件就是众所周知的*state dictionary*; 它包含模型的所有权重。这两个文件密切相关;这个配置是了解您的模型架构所必需的,而模型权重则是您模型的参数。
Expand Down
6 changes: 3 additions & 3 deletions chapters/zh-TW/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ model.save_pretrained("directory_on_my_computer")
```
ls directory_on_my_computer

config.json pytorch_model.bin
config.json model.safetensors
```
{:else}
```
Expand All @@ -199,10 +199,10 @@ config.json
文件,您將識別構建模型體系結構所需的屬性。該文件還包含一些元數據,例如檢查點的來源以及上次保存檢查點時使用的🤗 Transformers版本。

{#if fw === 'pt'}
這個 *pytorch_model.bin* 文件就是眾所周知的*state dictionary*; 它包含模型的所有權重。這兩個文件齊頭並進;配置是瞭解模型體系結構所必需的,而模型權重是模型的參數。
這個 *model.safetensors* 文件就是眾所周知的*state dictionary*; 它包含模型的所有權重。這兩個文件齊頭並進;配置是瞭解模型體系結構所必需的,而模型權重是模型的參數。

{:else}
這個 *pytorch_model.bin* 文件就是眾所周知的*state dictionary*; 它包含模型的所有權重。這兩個文件齊頭並進;配置是瞭解模型體系結構所必需的,而模型權重是模型的參數。
這個 *model.safetensors* 文件就是眾所周知的*state dictionary*; 它包含模型的所有權重。這兩個文件齊頭並進;配置是瞭解模型體系結構所必需的,而模型權重是模型的參數。

{/if}

Expand Down
Loading