> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-update-reference-docs-60.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# File

export const GitHubLink = ({url, compact = false}) => <a href={url} target="_blank" rel="noopener noreferrer" className={compact ? "source-link" : "github-source-link"}>
    {compact ? "ソースを表示" : <>
    <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
      <path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
    </svg>
    GitHub のソース
      </>}
  </a>;

<GitHubLink compact url="https://github.com/wandb/wandb/blob/main/wandb/apis/public/files.py#L246" />

## <Badge color="yellow" size="lg" shape="rounded">クラス</Badge> wandb.apis.public.File

W\&B に保存された file。

W\&B に保存された単一の file を表します。file のメタデータにもアクセスできます。file は特定の run に関連付けられており、テキストファイル、モデルの重み、データセット、可視化、その他の Artifacts などを含めることができます。file のダウンロード、削除、プロパティへのアクセスが可能です。

特定の run にログされた特定の file を絞り込むには、辞書で 1 つ以上の属性を指定します。次のキーを使用して検索できます。

* id (str): file を含む run の ID
* name (str): file名
* url (str): file へのパス
* direct\_url (str): バケット内の file へのパス
* sizeBytes (int): fileサイズ (バイト単位)
* md5 (str): file の md5
* mimetype (str): file の MIME タイプ
* updated\_at (str): 最終更新のタイムスタンプ
* path\_uri (str): バケット内の file へのパス。現在は S3 オブジェクトと参照fileでのみ利用可能です

<div id="properties">
  ## プロパティ
</div>

<ResponseField name="path_uri" type="file が S3 に保存されている場合は S3 URI（例: 's3://bucket/path/to/file'）、参照 file の場合は直接 URL、利用できない場合は空の string。">
  ストレージ バケット内の file の URI パスを返します。
</ResponseField>

<ResponseField name="size" type="int">
  file のサイズをバイト単位で返します。
</ResponseField>

<div id="methods">
  ## メソッド
</div>

### <Badge color="blue" size="lg" shape="rounded">メソッド</Badge> File.delete()

```python theme={null}
self
```

W\&B サーバーからこの file を削除します。

### <Badge color="blue" size="lg" shape="rounded">メソッド</Badge> File.download()

```python theme={null}
self,
root: 'str' = '.',
replace: 'bool' = False,
exist_ok: 'bool' = False,
api: 'Api | None' = None
```

wandb サーバーから、run が以前に保存した file をダウンロードします。

<div id="arguments">
  ##### 引数
</div>

<ResponseField name="root" type="str">
  file の保存先となるローカルディレクトリ。デフォルトは現在の作業ディレクトリ (`"."`) です。
</ResponseField>

<ResponseField name="replace" type="bool">
  `True` の場合、ローカルfileが存在するとダウンロード時に上書きします。デフォルトは `False` です。
</ResponseField>

<ResponseField name="exist_ok" type="bool">
  `True` の場合、file がすでに存在していても `ValueError` を発生させず、`replace=True` でない限り再ダウンロードもしません。デフォルトは `False` です。
</ResponseField>

<ResponseField name="api" type="Api | None">
  指定した場合、file のダウンロードに使用する `Api` インスタンス。
</ResponseField>
