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

# 파일

export const GitHubLink = ({url}) => <a href={url} target="_blank" rel="noopener noreferrer" className="github-source-link">
    <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 source
  </a>;

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

## <kbd>class</kbd> `File`

W\&B에 저장된 파일입니다.

W\&B에 저장된 단일 파일을 나타냅니다. 파일 메타데이터에 대한 엑세스를 포함합니다. 파일은 특정 run 과 연결되며 텍스트 파일, 모델 가중치, Datasets, 시각화 및 기타 Artifacts 를 포함할 수 있습니다. 파일을 다운로드하거나 삭제할 수 있으며 파일 속성에 엑세스할 수 있습니다.

특정 run 에 로그된 특정 파일을 찾으려면 사전 에 하나 이상의 속성을 지정하세요. 다음 키를 사용하여 검색할 수 있습니다:

* id (str): 파일을 포함하는 run 의 ID
* name (str): 파일 이름
* url (str): 파일 경로
* direct\_url (str): 버킷 내 파일 경로
* sizeBytes (int): 바이트 단위의 파일 크기
* md5 (str): 파일의 md5
* mimetype (str): 파일의 mimetype
* updated\_at (str): 마지막 업데이트 타임스탬프
* path\_uri (str): 버킷 내 파일 경로, 현재 S3 오브젝트 및 참조 파일에 대해서만 사용 가능

**Args:**

* `client`: 파일을 포함하는 run 오브젝트
* `attrs` (dict): 파일을 정의하는 속성 사전
* `run`: 파일을 포함하는 run 오브젝트

### <kbd>property</kbd> File.path\_uri

스토리지 버킷 내 파일의 URI 경로를 반환합니다.

**Returns:**

* `str`: 파일이 S3에 저장된 경우 S3 URI(예: 's3://bucket/path/to/file'), 참조 파일인 경우 direct URL, 사용 불가능한 경우 빈 문자열을 반환합니다.

**Returns:**

* `str`: path\_uri 속성 값.

***

### <kbd>property</kbd> File.size

바이트 단위의 파일 크기를 반환합니다.

***

### <kbd>method</kbd> `File.delete`

```python theme={null}
delete()
```

W\&B 서버 에서 파일을 삭제합니다.

***

### <kbd>method</kbd> `File.download`

```python theme={null}
download(
    root: 'str' = '.',
    replace: 'bool' = False,
    exist_ok: 'bool' = False,
    api: 'Api | None' = None
) → io.TextIOWrapper
```

이전에 run 에 의해 저장된 파일을 wandb 서버 에서 다운로드합니다.

**Args:**

* `root`: 파일을 저장할 로컬 디렉토리. 기본값은 현재 작업 디렉토리(".")입니다.
* `replace`: `True`인 경우, 로컬 파일이 존재하면 다운로드 시 덮어씁니다. 기본값은 `False`입니다.
* `exist_ok`: `True`인 경우, 파일이 이미 존재해도 ValueError를 발생시키지 않으며 replace=True가 아닌 한 다시 다운로드하지 않습니다. 기본값은 `False`입니다.
* `api`: 지정된 경우, 파일을 다운로드하는 데 사용되는 `Api` 인스턴스입니다.

**Raises:**
파일이 이미 존재하고 `replace=False` 및 `exist_ok=False`인 경우 `ValueError`가 발생합니다.
