메인 콘텐츠로 건너뛰기

오브젝트 게시하기

Weave 의 직렬화 레이어는 오브젝트를 저장하고 버전을 관리합니다.
import weave
# 'intro-example' 프로젝트에 대한 트래킹 초기화
weave.init('intro-example')
# 리스트를 저장하고 'cat-names'라는 이름을 부여함
weave.publish(['felix', 'jimbo', 'billie'], 'cat-names')
이름을 지정하여 오브젝트를 저장하면, 해당 오브젝트가 존재하지 않을 경우 첫 번째 버전이 생성됩니다.

오브젝트 다시 가져오기

weave.publish 는 Ref 를 반환합니다. 모든 Ref 에 대해 .get() 을 호출하여 오브젝트를 다시 가져올 수 있습니다.Ref 를 생성한 다음 오브젝트를 페치(fetch)할 수 있습니다.
weave.init('intro-example')
cat_names = weave.ref('cat-names').get()

오브젝트 삭제하기

오브젝트의 버전을 삭제하려면, 오브젝트 Ref 에 대해 .delete() 를 호출하세요.
weave.init('intro-example')
cat_names_ref = weave.ref('cat-names:v1')
cat_names_ref.delete()
삭제된 오브젝트에 엑세스하려고 하면 오류가 발생합니다. 삭제된 오브젝트를 참조하는 오브젝트를 확인(resolve)하려고 하면 삭제된 오브젝트 대신 DeletedRef 오브젝트가 반환됩니다.

Ref 스타일

정규화된(Fully qualified) Weave 오브젝트 Ref URI 는 다음과 같습니다:
weave://<entity>/<project>/object/<object_name>:<object_version>
  • entity: wandb entity (사용자 이름 또는 팀)
  • project: wandb project
  • object_name: 오브젝트 이름
  • object_version: 버전 해시, v0, v1… 과 같은 문자열, 또는 “:latest” 와 같은 에일리어스. 모든 오브젝트는 “:latest” 에일리어스를 가집니다.
Ref 는 다음과 같은 몇 가지 스타일로 구성할 수 있습니다:
  • weave.ref(<name>): weave.init(<project>) 호출이 필요합니다. “:latest” 버전을 참조합니다.
  • weave.ref(<name>:<version>): weave.init(<project>) 호출이 필요합니다.
  • weave.ref(<fully_qualified_ref_uri>): weave.init 을 호출하지 않고도 구성할 수 있습니다.