ããŒã¿ã»ãã¥ãªãã£ãšæ©æ¢°åŠç¿ã®å¹çåã¯ããžãã¹æé·ã®ã«ã®ããã®èª²é¡ã解決ããããŒãã¯ãããžãŒããsafetensors ckptãã§ããä»æ¥ãç§ãã¡ãã玹ä»ããã®ã¯safetensors ckptã®åºæ¬çãªç解ããå§ãŸãããã®ç¹åŸŽãå®éã®å©çšã·ããªãªãããŒãžã§ã³ç®¡çã®æ¹æ³ã«è³ããŸã§ã®å šè²ãããžãã¹ããŒãœã³ã«æé©ãªããŒã¿ç®¡çãœãªã¥ãŒã·ã§ã³ã®ã€ã³ã¹ããŒã«ãšèšå®ãããŒã¿ã»ãã¥ãªãã£ããããŠãã·ã³ã©ãŒãã³ã°ãžã®å¿çšã«ãããå¹ åºãæ å ±ã端çã«ãå±ãããsafetensors ckptãéããæå 端ã®ããŒã¿ãã³ããªã³ã°æŠç¥ãæ¢æ±ããŸãã
1. safetensors ckptãšã¯ïŒ
safetensors ckptãšããçšèªã¯ã深局åŠç¿ãæ©æ¢°åŠç¿ã®æèã§çšããããããšãå€ããç¹ã«ãã§ãã¯ãã€ã³ããã¡ã€ã«ã®å®å šãªåãæ±ãã«é¢é£ããŠããŸããæ©æ¢°åŠç¿ã¢ãã«ã®ãã¬ãŒãã³ã°äžã«å®æçã«äœæããããããã®ãã§ãã¯ãã€ã³ããã¡ã€ã«ã«ã¯ãåŠç¿æžã¿ã¢ãã«ã®ç¶æ ãä¿åãããŠãããããŸããŸãªçšéã§éèŠèŠãããŸãã
æè¡ã®é²åã«ãããã¢ãã«ã®ããã©ãŒãã³ã¹ãäžå®ã®ééã§ä¿åããå¿ èŠã«å¿ããŠå®¹æã«åŸ©å ã§ããããã«ããããšãäžè¬çã«ãªããŸãããsafetensors ckptã¯ãã®ããã»ã¹ãæããã®ã§ãäž»ã«ãã¬ãŒãã³ã°äžã®é²æãèšé²ããæœåšçãªåé¡çºçæã«çŽ æ©ã察åŠã§ããããã®ä»çµã¿ã§ãã
safetensors ckptã¯ããã®åã®éããããŒã¿ãšã¢ãã«ã®å®å šæ§ã«æ³šç®ããã¢ãããŒããæ¡çšããŠããŸãããã¬ãŒãã³ã°éçšã§çºçããæçšãªããŒã¿ãä¿è·ããåæã«ã¢ãã«ã®ãã¬ãŒãã³ã°ã¹ããŒã¿ã¹ã確å®ã«ä¿åããããšã§ããŠãŒã¶ãŒã«ä¿¡é Œæ§ãšå©äŸ¿æ§ãæäŸããŠããŸãã
1.1 safetensors ckptã®åºæ¬çãªç解
safetensors ckptãã¡ã€ã«ã¯ãã¢ãã«ã®ãã¬ãŒãã³ã°ã®ç¶æ ãä¿åããããã«çšãããããã®æ§é ã«ã¯ã¢ãã«ã®éã¿ãèšå®ãã©ã¡ãŒã¿ãŒãæé©åã«é¢ãã詳现æ å ±ãªã©ãå«ãŸããŠããŸããããã«ããããã¬ãŒãã³ã°ãäžæããå Žåã«ããéäžããåéããããšãå¯èœãšãªã£ãŠããŸãã
ãã®ä»çµã¿ã®å©ç¹ã¯èšãç¥ãããç¹ã«èšç®ãªãœãŒã¹ãéãããŠããç°å¢ããé害å埩ã®ã¡ã«ããºã ãå¿ èŠãªå€§èŠæš¡ãªãã¬ãŒãã³ã°ã¿ã¹ã¯ã«ãããŠã¯éèŠãªåœ¹å²ãæãããŸããå®å šã§æççãªãã¬ãŒãã³ã°ã¯ãæéãšã³ã¹ããå€§å¹ ã«ç¯çŽããããšã«ãç¹ãããŸãã
ãŸããsafetensors ckptæŠç¥ã¯ãç°ãªãæç¹ã§ã®ã¢ãã«ã®ããã©ãŒãã³ã¹ãæ¯èŒãããšããå©ç¹ããããŸããããã«ããããã¬ãŒãã³ã°éçšã§æé©ãªçµæãåºããç¹å®ã®ãã§ãã¯ãã€ã³ãã«æ»ããåè©äŸ¡ããããšãã§ããŸãã
1.2 safetensors ckptã®äž»ãªç¹åŸŽ
safetensors ckptãã¡ã€ã«ã«ã¯ããã€ãã®éç«ã£ãç¹åŸŽããããŸãããã®äžã€ããäºææ§ã®é«ãã§ããå€æ§ãªãã¬ãŒã ã¯ãŒã¯ãããŒã«ãšé£æºããŠäœ¿çšããããšãã§ããç°å¢ãåããæè»ãªå°å ¥ãå¯èœã§ãã
次ã«éèŠãªç¹åŸŽã¯ãå ç¢æ§ã§ããsafetensors ckptãã¡ã€ã«ã¯ç Žæãã«ããããã¬ãŒãã³ã°äžã®æå³ããªãäžæã«åŒ·ãæ§é ãæã£ãŠããŸããããã«ããããŠãŒã¶ãŒã¯ããŒã¿æ倱ã®ãªã¹ã¯ãæå°éã«æãã€ã€ããã¬ãŒãã³ã°ããã»ã¹ã«å°å¿µã§ããŸãã
æåŸã«ãã»ãã¥ãªãã£ãsafetensors ckptã®å€§ããªç¹åŸŽã§ããããŒã¿ã®éèŠæ§ãé«ãŸã£ãŠããæšä»ãsafetensors ckptãã¡ã€ã«ã¯å³æ Œãªã»ãã¥ãªãã£å¯Ÿçãæœãããšã§ã貎éãªãã¬ãŒãã³ã°ããŒã¿ã®ä¿å šã確å®ã«å®çŸããŠããŸãã
1.3 safetensors ckptã®å©çšã·ããªãª
safetensors ckptãã¡ã€ã«ã¯ãæ§ã ãªå©çšã·ããªãªã§ãã®äŸ¡å€ãçºæ®ããŸãã倧éã®ããŒã¿ãçšããŠé·æéã«ãããè¡ããããã¬ãŒãã³ã°ã§ã¯ãå®æçãªãã§ãã¯ãã€ã³ãã®äœæãäžå¯æ¬ ã§ããããã«ããããããªãé害ã®çºçæãæå°éã®é²è¡ç¶æ³ã®ã¿ã倱ããè¿ éãªåéãå¯èœã«ãªããŸãã
ãŸããåæ£ã³ã³ãã¥ãŒãã£ã³ã°ãçšãããã¬ãŒãã³ã°ã®å Žåã«ããsafetensors ckptã¯å¹æãçºæ®ããŸããè€æ°ã®ãã·ã³ãŸãã¯ã¯ã©ãŠããªãœãŒã¹ãå©çšããéã«ãäžè²«æ§ã®ãããã§ãã¯ãã€ã³ããäœæããããšã§ãã·ã¹ãã ã®è² è·åæ£ãšå¹çã®åäžãå³ããŸãã
ããã«ãç 究éçºãå®éšçãªæ®µéã«ããããããžã§ã¯ãã§ã¯ãç°ãªãã¢ãã«ã®èšå®ããã€ããŒãã©ã¡ãŒã¿ã®èª¿æŽãããå Žåãsafetensors ckptã®æŽ»çšã«ãã£ãŠçµæã®åçŸæ§ãåååæã容æã«ãªããŸãã
1.4 safetensors ckptã®ããŒãžã§ã³ç®¡ç
safetensors ckptãã¡ã€ã«ã管çããéããã®ããŒãžã§ã³ãé©åã«ç®¡çããããšã¯æ¥µããŠéèŠã§ãããã§ãã¯ãã€ã³ããããŒãžã§ã³ç®¡çããããšã§ããã¬ãŒãã³ã°ã®é²è¡ç¶æ³ãæ確ã«ããç°ãªãææãå®éšæ¡ä»¶äžã§ã®ã¢ãã«ã粟確ã«æ¯èŒã»è©äŸ¡ããããšãå¯èœã«ãªããŸãã
ããŒãžã§ã³ç®¡çã®ããã«ã¯ããã§ãã¯ãã€ã³ããã¡ã€ã«ã«äžæãªèå¥åãä»äžãããã¬ãŒãã³ã°ã®å段éã«ãããŠçããå€æŽãåãããããèšé²ãããã©ã¯ãã£ã¹ãæšå¥šãããŸããããã«ãããããŒã ã¡ã³ããŒãå°æ¥ã®å©çšè ã远跡ããŠäœæ¥ããéã®æ··ä¹±ãé¿ããããšãã§ããŸãã
ããã«ãããŒãžã§ã³ç®¡çã·ã¹ãã ãšsafetensors ckptãã¡ã€ã«ãçµ±åããããšã«ãã£ãŠãè€æ°äººã§ã®å ±åäœæ¥ã«ãããäžè²«æ§ã®ä¿æããã¬ãŒãã³ã°ã®åã¹ããŒãžã§ã®å€æŽå±¥æŽã®ä¿å šããããŠé«åºŠãªã¬ãã¥ãŒãšç£æ»ã®ããã®åºç€ãæäŸããŸãã
2. safetensors ckptã®ã€ã³ã¹ããŒã«ãšèšå®
safetensors ckptã¯ãããŒã¿ã®å®å šãªåãæ±ãããµããŒãããããã®éèŠãªããŒã«ã§ãããã®ããŒã«ã䜿çšãããšãã»ãã¥ãªãã£ãç¶æããªãããããŒã¿ã®ä¿åã»è»¢éãæè»ã«è¡ãããšãå¯èœã«ãªããŸããã€ã³ã¹ããŒã«ããèšå®ãŸã§ãæé ãäžå¯§ã«èª¬æããŸãã
ãã®ãœãããŠã§ã¢ãå¹æçã«å©çšããããã«ã¯ãæ£ããæé ã§ã®ã€ã³ã¹ããŒã«ãšãé©åãªèšå®ãå¿ èŠäžå¯æ¬ ã§ããèšäºãéããŠãsafetensors ckptã®ã»ããã¢ããæ¹æ³ããããããã解説ããŠãããŸãã
åé¡ãªãèšå®ãå®äºãããæ¥åãç 究ã«ãããŠsafetensors ckptãæã€å šæ©èœã掻çšããããã®ã¬ã€ããšããŠãæé©ãªæ å ±ãæäŸããããŸãã
2.1 safetensors ckptã®ã€ã³ã¹ããŒã«æé
å§ãã«ãsafetensors ckptã®ã€ã³ã¹ããŒã«ã«ã¯ç¹å®ã®äºææ§ã®ããç°å¢ãæ±ããããŸãã察å¿ããŠãããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãäŸåã©ã€ãã©ãªã«ã€ããŠãå ¬åŒã®ããã¥ã¡ã³ãã確èªããããšããå§ãããŸãã
次ã«ãå ¬åŒãŠã§ããµã€ãããsafetensors ckptã®ææ°çãããŠã³ããŒãããã·ã¹ãã ç°å¢ã«å¿ããã€ã³ã¹ããŒã«ã³ãã³ããå®è¡ããŸããå€ãã®å Žåãpipãªã©ã®ããã±ãŒãžãããŒãžã£ã䜿çšããããšã§ç°¡åã«ã€ã³ã¹ããŒã«ã§ããããšãæåŸ ãããŠããŸãã
æåŸã«ã€ã³ã¹ããŒã«ãçµããåŸã¯ãåäœç¢ºèªã®ããã®ãã¹ãã¹ã¯ãªãããå®è¡ããŠãã€ã³ã¹ããŒã«ãæ£ããè¡ãããããæ€èšŒããããšãéèŠã§ãããšã©ãŒãåºãå Žåã¯ããã°ã確èªããå¿ èŠãªä¿®æ£ãè¡ã£ãŠãã ããã
2.2 åæèšå®ãšæ§æ
ã€ã³ã¹ããŒã«åŸã®åå§èšå®ã¯safetensors ckptã䜿çšããäžã§éåžžã«éèŠã§ããèšå®ãã¡ã€ã«ã¯æ確ã«èª¬æãããããã¥ã¡ã³ããã³ãã³ãã©ã€ã³ãã«ããåç §ããŠæé©ãªå€ã«èšå®ããŠãã ããã
æ§æèšå®ã§ã¯ãã»ãã¥ãªãã£ããªã·ãŒãããŒã¿ãã³ãã«æ¹æ³ãªã©ãå©çšããç°å¢ã«ç¹åããèšå®ãæ±ããããŸããå°éçãªç¥èãå¿ èŠãšãªãããšããããããããã§ã¯å°é家ã®æèŠãæ±ããããšãæ€èšããŸãããã
æ£ç¢ºãªæ§æã確ç«ããããšã§ãsafetensors ckptã¯æ倧éã«æ§èœãçºæ®ããããŒã¿ã®å®å šãä¿ã¡ãªããåæ»ãªéçšãæ¯æŽããŸããçåç¹ãããã°ããã€ã§ããµããŒããæ±ããŠãã ããã
2.3 safetensors ckptã®ã¢ããããŒãæ¹æ³
ãœãããŠã§ã¢ãææ°ã®ç¶æ ã«ä¿ã€ããã«ã¯å®æçãªã¢ããããŒããäžå¯æ¬ ã§ããsafetensors ckptã®ã¢ããããŒããç°¡åã«è¡ãããããéçºããŒã ã¯äœ¿ããããã¢ããããŒãããã»ã¹ãæäŸããŠããŸãã
ã¢ããããŒãæé ãšããŠã¯ããŸãçŸåšã®ããŒãžã§ã³ã確èªããå ¬åŒãŠã§ããµã€ãããªããžããªã§å©çšå¯èœãªæ°ããããŒãžã§ã³ããã§ãã¯ããŸããã¢ããããŒãã¯åºæ¬çã«ã¯æ¢åã®ã€ã³ã¹ããŒã«ã³ãã³ããåå©çšããã ãã§ãåŠçãå®äºããããšãã§ããŸãã
ææ°ã®ã»ãã¥ãªãã£ããããæ©èœè¿œå ãçã蟌ãŸããã¢ããããŒãããã¡æ©ãé©çšããããšã§ãããŒã¿ã®å®å šæ§ãåžžã«æåç·ã§å®ãããšãå¯èœãšãªããŸããã¢ããããŒãããã»ã¹ã§åé¡ãçããå Žåã«ã¯ããã©ãã«ã·ã¥ãŒãã£ã³ã°ã¬ã€ããåç §ããããšãæšå¥šãããŸãã
2.4 ãã©ãã«ã·ã¥ãŒãã£ã³ã°ãšãµããŒã
safetensors ckptã®æäœäžã«äœããã®äžå ·åãçºçããå Žåã¯ããã©ãã«ã·ã¥ãŒãã£ã³ã°ã¬ã€ãã確èªããããšã第äžæ©ã§ããå€ãã®äžè¬çãªåé¡ã¯ããã®ã¬ã€ããåç §ããããšã§è§£æ±ºããããšãã§ããŸãã
解決ã§ããªãåé¡ããããæè¡çãªæ¯æŽãå¿ èŠãªå Žåã«ã¯ãsafetensors ckptã®éçºããŒã ãã³ãã¥ããã£ãã©ãŒã©ã ã§è³ªåããããšããå§ãããŸããçµéšè±ããªéçºè ãä»ã®ãŠãŒã¶ãŒã察å¿ããŠãããå Žåãå€ãã§ãã
æçµçã«ã¯ãæåã®ãµããŒãå¥çŽãçµã¶ããšã§å°é家ã«ããåå¥ãµããŒããåããããšãã§ããŸããsafetensors ckptã®éçšãã¹ã ãŒãºã«è¡ãããäŒæ¥ãç 究æ©é¢ã«ã¯ããã®éžæãæšå¥šããŸãã
3. safetensors ckptã䜿çšããããŒã¿ç®¡ç
safetensors ckptã¯ãéåžžã«å¹æçãªããŒã¿ç®¡çããŒã«ã§ãããã®ã·ã¹ãã ã¯ãæ§ã ãªããŒã¿ãœãŒã¹ããå®å šã«ããŒã¿ãåéããããã管çããããã®ä¿¡é Œæ§ã®é«ãæ¹æ³ãæäŸããŸããç¹ã«ã倧éã®ããŒã¿ã»ãããæ±ãå Žåãsafetensors ckptã¯äžå¯æ¬ ãªããŒã«ãšãªããŸãã
ãã®èšäºã§ã¯ãsafetensors ckptã掻çšããããŒã¿ç®¡çã®ãã¹ããã©ã¯ãã£ã¹ã«çŠç¹ãåœãŠãŸããããŒã¿ã®ã»ãã¥ãªãã£ãããã¯ã¢ããæŠç¥ãé«å¯çšæ§ãšçœå®³åŸ©æ§ããã»ã¹ããããŠããŒã¿ãžã®ã¢ã¯ã»ã¹ãšããã©ãŒãã³ã¹ã®æé©åã«ã€ããŠè©³ããèŠãŠãããŸãããã
safetensors ckptã®æ¡çšã¯ãããŒã¿ãåžžã«å®å šã§å©çšå¯èœãªç¶æ ãä¿ã¡ãäŒæ¥ãæ å ±è³ç£ãæ倧éã«æŽ»çšããããã®ããŒãšãªããŸããããããå§ããŠãå¹æçãªããŒã¿ç®¡çããã»ã¹ã®æ§ç¯ã«å¯Ÿããç解ãæ·±ããŠãããŸãããã
3.1 ããŒã¿ã»ãã¥ãªãã£ã«é¢ããèæ ®äºé
ããŒã¿ã»ãã¥ãªãã£ã¯ãsafetensors ckptãçšããããŒã¿ç®¡çã«ãããŠæãéèŠãªåŽé¢ã®äžã€ã§ããäžæ žãšãªãã»ãã¥ãªãã£æ©èœã¯ãäžæ£ã¢ã¯ã»ã¹ãããŒã¿æŒæŽ©ãé²ãããã«ãããŒã¿ã®å®å šæ§ãšæ©å¯æ§ãä¿è·ããããšã§ãã
safetensors ckptã§ã®ããŒã¿ä¿è·ã«ã¯ãæå·åãã¢ã¯ã»ã¹å¶åŸ¡ãããã³ç£æ»ãã¬ã€ã«ãå«ãŸããŸããæå·åã¯ããŒã¿ãäžå¯è§£ãªåœ¢ã«å€æããããšã§ãã¢ã¯ã»ã¹å¶åŸ¡ã¯é©åãªæš©éãæã€ãŠãŒã¶ã®ã¿ãããŒã¿ã«ã¢ã¯ã»ã¹ã§ããããã«å¶éããŸãããŸããç£æ»ãã¬ã€ã«ã¯å šãŠã®ããŒã¿ã¢ã¯ã»ã¹æŽ»åãèšé²ããã»ãã¥ãªãã£éåã®èª¿æ»ã«åœ¹ç«ã¡ãŸãã
ãããã®ã»ãã¥ãªãã£æ©èœã¯ãããŒã¿ã®å®å šãä¿ã¡ãªãããçµç¹ããªã¹ã¯ã管çããã³ã³ãã©ã€ã¢ã³ã¹èŠä»¶ãæºããã®ã«äžå¯æ¬ ã§ããsafetensors ckptã䜿çšããéã«ã¯ããããã®ã»ãã¥ãªãã£æ©èœãé©åã«èšå®ããå®æçãªã¬ãã¥ãŒãè¡ãããšãæšå¥šãããŸãã
3.2 å¹ççãªããŒã¿ããã¯ã¢ããæŠç¥
ããŒã¿æ倱ã¯äŒæ¥ã«ãšã£ãŠæ·±å»ãªåé¡ãåŒãèµ·ãããŸãããã®ãããsafetensors ckptãçšããå¹ççãªããŒã¿ããã¯ã¢ããæŠç¥ã®å®æœãå¿ èŠã§ããå®æçãªããã¯ã¢ããã¯ãããŒã¿ã®ç Žæãæ倱ããçŽ æ©ãå埩ããããã«éèŠã§ãã
ããã¯ã¢ããã®ããã»ã¹ã«ã¯ãå·®åããã¯ã¢ãããå¢åããã¯ã¢ãããšãã£ãæ§ã ãªææ³ããããŸãããããã®ææ³ã¯ãããŒã¿ã®å šã³ããŒã ãã§ãªããå€æŽãããéšåã®ã¿ãèšé²ããããšã§ãå¹çãšç¯çŽã®ãã©ã³ã¹ãåããŸãã
safetensors ckptã掻çšããããšã«ãããèªååãããããã¯ã¢ããã¹ã±ãžã¥ãŒã«ãèšå®ããããšãã§ããããŒã¿ç®¡çã®ç ©éãã軜æžããŸããéèŠãªã®ã¯ãå®æçãªããã¯ã¢ãããšãªã¹ãã¢ã®ãã¹ããè¡ããå®éã®ç·æ¥æã«åããŠããããšã§ãã
3.3 é«å¯çšæ§ãšçœå®³åŸ©æ§
é«å¯çšæ§ãšã¯ãããŒã¿ãšã¢ããªã±ãŒã·ã§ã³ãé£ç¶ããŠçšŒåããèœåãæããŸããäžæ¹ãçœå®³åŸ©æ§ã¯ãäºæãã¬äºæ ãçºçããéã«ããŒã¿ãšæ©èœãè¿ éã«åŸ©æ§ãããããã»ã¹ã§ããsafetensors ckptã¯ãããäž¡æ¹ã®ããã»ã¹ãæ¯æŽããŸãã
safetensors ckptã«ã¯ãã·ã¹ãã é害æã«ããŒã¿ãä¿è·ãããµãŒãã¹ã®äžæãæå°éã«æããåé·æ§ãšã¬ããªã±ãŒã·ã§ã³ã®æ©èœãåãã£ãŠããŸãããã®ãããªæ©èœã¯ãããžãã¹ã®é£ç¶æ§ãšé¡§å®¢ã®ä¿¡é Œãç¶æããäžã§æ¥µããŠéèŠã§ãã
èšç»ãããçœå®³åŸ©æ§æŠç¥ã«safetensors ckptãçµã¿èŸŒãããšã§ãäŒæ¥ã¯éèŠãªããŒã¿ãè¿ éã«åŸ©å ãããªãã¬ãŒã·ã§ã³ã«äžãã圱é¿ãæå°åããããšãå¯èœãšãªããŸãããã®ããã»ã¹ãäºåã«èšèšããŠããããšããäºæž¬äžèœãªç¶æ³ãžã®æºåãšãªããŸãã
3.4 ããŒã¿ã¢ã¯ã»ã¹ãšããã©ãŒãã³ã¹æé©å
ããŒã¿ã¢ã¯ã»ã¹ãšããã©ãŒãã³ã¹æé©åã¯ãsafetensors ckptã䜿çšããéã«ç¹ã«æ³šç®ãã¹ãç¹ã§ãããŠãŒã¶ãå¿ èŠãšããæ å ±ã«è¿ éã«ã¢ã¯ã»ã¹ã§ãããããã·ã¹ãã ãé©åã«èª¿æŽãããŠããå¿ èŠããããŸãã
safetensors ckptã¯ãããŒã¿ãã£ãã·ã¥ãã€ã³ããã¯ã¹ãã¯ãšãªæé©åãªã©ã®ãã¯ããã¯ãçšããŠããŒã¿ããŒã¹ããã©ãŒãã³ã¹ãæ¹åããŸãããã®ãããªæé©åã¯ãåæ¢æéã®åæžãšããŒã¿ããŒã¹ã®åŠçé床ã®åäžã«å¯äžããŸãã
å¹æçãªããŒã¿ç®¡çã®ããã«ã¯ãsafetensors ckptã§ã®ãããã®æ©èœãååã«å©çšããããšãéèŠã§ããããŒã¿ã¢ã¯ã»ã¹ã®æ¹åã¯ããžãã¹ã®æè»æ§ãšå¿çæ§ãé«ãã競äºåªäœæ§ãããããå¯èœæ§ããããŸããããã©ãŒãã³ã¹ã®ç£èŠãšç¶ç¶çãªèª¿æŽã«ãããã·ã¹ãã å šäœã®å¹çãä¿ãããã®ã§ãã
4. safetensors ckptãšãã·ã³ã©ãŒãã³ã°
safetensors ckptã¯ãã·ã³ã©ãŒãã³ã°åéã§éèŠãªåœ¹å²ãæããæè¡ã®äžã€ã§ãããã·ã³ã©ãŒãã³ã°ã¢ãã«ãéçºããéã«ã¯ãããŒã¿ã®æºåããã¢ãã«ã®é åžãŸã§æ§ã ãªã¹ããŒãžããããŸãããsafetensors ckptã¯ãããå šãŠã®ããã»ã¹ã«ãããå®å šãã€å¹ççãªã¯ãŒã¯ãããŒãå¯èœã«ããŸãã
ãã®èšäºã§ã¯ãsafetensors ckptãçšããŠã®ãã·ã³ã©ãŒãã³ã°éçºã®åã¹ããŒãžã«ã€ããŠãç¹ã«ããŒã¿ã»ããã®æºåãã¢ãã«ãã¬ãŒãã³ã°ã®æé©åãåŠç¿æžã¿ã¢ãã«ã®ä¿åãšåå©çšã«éç¹ã眮ã説æããŸãããŸãã倧èŠæš¡ãªæ©æ¢°åŠç¿ãããžã§ã¯ãã«ãããéçšã®ãã€ã³ãã«ã€ããŠã觊ããŸãã
ãã®æè¡ã«é¢ããæ£ããç¥èãšé©åãªéçšæ¹æ³ãç解ããããšã§ããããžã§ã¯ãã®ææãæ倧éã«åŒãåºããéçºã®å¹çæ§ãé£èºçã«åäžãããããšãå¯èœã«ãªããŸãã
4.1 ããŒã¿ã»ããã®æºåãšåŠç
ãã·ã³ã©ãŒãã³ã°ã¢ãã«ãèšç·Žããããã«ã¯ããŸãé©åãªããŒã¿ã»ããã®æºåãå¿ èŠã§ããsafetensors ckptã¯ãããŒã¿ã»ããã®å®å šãªåãæ±ããä¿èšŒãã€ã€ãå¹ççãªããŒã¿ã®ååŠçãå€æãæ¯æŽããŸããããã«ãããããŒã¿ã®è³ªãšã»ãã¥ãªãã£ãåæã«ç¢ºä¿ã§ããŸãã
ããŒã¿ã®ååŠçã«ã¯ãæ¬ æå€ã®åŠçãç°åžžå€ã®æ€åºãšæé€ãç¹åŸŽéã®ã¹ã±ãŒãªã³ã°ãªã©ãå«ãŸããŸããsafetensors ckptã䜿çšããããšã§ããããã®äœæ¥ãå¹ççãã€åŸ¹åºçã«è¡ãããšãã§ããã®ã§ãã
ããã«ãããŒã¿ã®ã»ãã¥ãªãã£ãä¿ã¡ãªãããã©ã®ããã«ããŠããŒã¿ã»ãããè€æ°ã®ã¢ãã«ã§äºææ§ãæãããŠå ±æããããšããç¹ã«ãããŠããsafetensors ckptã¯éèŠãªåœ¹å²ãæãããŸãã
4.2 ã¢ãã«ãã¬ãŒãã³ã°ã®æé©å
å¹ççãªã¢ãã«ãã¬ãŒãã³ã°ã«ã¯ããã©ã¡ãŒã¿ã®æ£ããéžæãšèšç®è³æºã®æé©ãªå©çšãäžå¯æ¬ ã§ããsafetensors ckptãå©çšãããšããããã®ããã»ã¹ãèªååãããã¬ãŒãã³ã°ã®ã¹ããŒããšæ§èœã倧ããåäžãããããšãã§ããŸãã
äŸãã°ããã€ããŒãã©ã¡ãŒã¿ã®èª¿æŽã§ã¯ãsafetensors ckptãéå»ã®å®è¡çµæããæé©ãªèšå®ãæšæž¬ããè©Šè¡é¯èª€ã®æéãåæžããŸãããŸããè€æ°ã®GPUãåæ£ã³ã³ãã¥ãŒãã£ã³ã°ãªãœãŒã¹ã䜿çšããéã«ãããã¬ãŒãã³ã°ã®ã¹ã±ãŒãªã³ã°ãå¹æçã«ç®¡çã§ããŸãã
ãã¬ãŒãã³ã°ããã»ã¹äžã«çºçããå¯èœæ§ã®ãããšã©ãŒãäžæã«å¯ŸããŠããsafetensors ckptã¯å®å šãªãã§ãã¯ãã€ã³ãä¿åæ©èœãæäŸãããããžã§ã¯ãã®é²è¡ã«å€§ããªé害ãåºãŠããŸããªã¹ã¯ãæããŸãã
4.3 åŠç¿æžã¿ã¢ãã«ã®ä¿åãšåå©çš
ã¢ãã«ãèšç·Žããããšããã®æçšæ§ãæ倧éã«æŽ»ããããã«ã¯ãåŠç¿æžã¿ã®ã¢ãã«ãä¿åããå°æ¥çã«åå©çšå¯èœãªç¶æ ã«ä¿ã€ããšãæ±ããããŸããsafetensors ckptã䜿çšããããšã§ãã¢ãã«ã®ç¶æ ãæè»ã«ä¿åãããã€ã§ãå¿ èŠãªæã«ç°¡åã«ã¢ã¯ã»ã¹ããããšãå¯èœã§ãã
ãã®ä¿åããããã§ãã¯ãã€ã³ããçšããããšã«ããããã¬ãŒãã³ã°ãããé²ãã 段éããåéããããç°ãªãããŒã¿ã»ããã§ã¢ãã«ãåå©çšãããããããšãã§ããŸããããã¯ç¹ã«ãæãšããŠæ°é±éã«ãããå¯èœæ§ã®ãããã¬ãŒãã³ã°æéãèæ ®ãããšãéåžžã«éèŠãªæ©èœã§ãã
ãŸããåŠç¿æžã¿ã¢ãã«ã®ãã§ãã¯ãã€ã³ããå ±æããããšã§ãå ±åç 究è ãã³ãã¥ããã£ã®ä»ã®ã¡ã³ããŒãåæ§ã®çµæã容æã«åçŸã§ããããã«ãªããªã©ãã³ã©ãã¬ãŒã·ã§ã³ã®åäžã«ãå¯äžããŸãã
4.4 倧èŠæš¡ãªæ©æ¢°åŠç¿ãããžã§ã¯ãã®éçš
倧èŠæš¡ãªæ©æ¢°åŠç¿ãããžã§ã¯ãã§ã¯ãããã»ã¹ããªãœãŒã¹ã®ç®¡çãããè€éã«ãªããŸããsafetensors ckptãé§äœ¿ããããšã§ããããžã§ã¯ãå šäœã®èšç·Žããã»ã¹ãçµ±å¶ããå€æ°ã®ã¢ãã«ãããŒã¿ã»ãããå¹ççã«åŠçã§ããããã«ãªããŸãã
èšç·Žã®é²è¡ç®¡çã ãã§ãªããåãã§ãã¯ãã€ã³ãã®æ§èœãã¢ãã¿ãªã³ã°ããç¶æ³ã«å¿ããŠãã¬ãŒãã³ã°æŠç¥ã調æŽããããšãå¯èœã§ãããŸãããã¬ãŒãã³ã°ããã»ã¹äžã«çæããã巚倧ãªãã°ãã¡ã€ã«ãããŒã¿ã®ç®¡çããsafetensors ckptã䜿çšããããšã§å®¹æã«ãªããŸãã
çµå±ã®ãšãããsafetensors ckptã¯å€§èŠæš¡ãããžã§ã¯ãã®éçšãã¹ã ãŒãºã«ããããŒã ããšã®é£æºã匷åããå šäœãšããŠã®ãããã¯ãã£ããã£ãåäžãããããã®äžå¯æ¬ ãªããŒã«ã§ãã
ãsafetensors ckptã®å¿çšäºäŸããšããæç« ããåºåãå§ããŸãããã®èšäºã¯ãæè¡ç³»ã©ã€ã¿ãŒãšããŠãããŒã¿ãµã€ãšã³ã¹ã«ãããsafetensors ckptã®æŽ»çšäºäŸã«å ãåœãŠãããšãç®çãšããŠããŸããèªè ãæ°ããç¥èã身ã«ã€ããããšã§ãèªèº«ã®ãããžã§ã¯ãã«å¿çšã§ããããæ å ±æäŸãå¿ãããŠããŸãã
5. safetensors ckptã®å¿çšäºäŸ
5.1 å®è·µçãªããŒã¿ãã³ããªã³ã°
safetensors ckptã¯ãå®è·µçãªããŒã¿ãã³ããªã³ã°ã«ãããŠããã®å¹åãçºæ®ããŸããããŒã¿åŠçããã»ã¹ã«ãããŠãå®å®æ§ãšåçŸæ§ã¯æ¥µããŠéèŠã§ããsafetensors ckptã䜿çšããããšã§ãããŒã¿ã»ããã®ããŒãžã§ã³ç®¡çã容æã«ãªããããŒã éã§ã®ã³ã©ãã¬ãŒã·ã§ã³ãã¹ã ãŒãºã«é²ããããŸãã
ç¹ã«ãè€éãªããŒã¿ãã©ã³ã¹ãã©ãŒã¡ãŒã·ã§ã³ãååŠçãè¡ãªã£ãéã®ãã§ãã¯ãã€ã³ãä¿åã«ãããŠãsafetensors ckptã¯æå¹ã§ããããã«ããããããžã§ã¯ãã¡ã³ããŒã¯ç°¡åã«ç¹å®ã®ããŒã¿åŠçã®ã¹ãããã«æ»ããå¿ èŠãªä¿®æ£ãè¿ éã«è¡ãããšãå¯èœãšãªããŸãã
safetensors ckptã¯ããããžã§ã¯ãã§äœ¿çšãããããŒã¿ã®æŽåæ§ãä¿ã¡ã€ã€ãæè»ãã€å¹ççãªããŒã¿ãã³ããªã³ã°ãæ¯æŽããã®ã§ããããã«ãããããŒã¿ã®å質ãäžå®ã«ä¿ã¡ãªããããããžã§ã¯ãã®é²è¡é床ãé«ããããšãã§ããŸãã
5.2 ã¯ã©ãŠããšã®çµ±åãœãªã¥ãŒã·ã§ã³
safetensors ckptã¯ã¯ã©ãŠããã©ãããã©ãŒã ãšçµ±åããããšã§ããã®äŸ¡å€ãããã«é«ããŸããã¯ã©ãŠãã¹ãã¬ãŒãžã«ckptãã¡ã€ã«ãä¿åããããšã§ããã€ã§ãã©ãã§ãããŒã¿ã«ã¢ã¯ã»ã¹ã§ããããã«ãªããé éå°ã®ããŒã ã¡ã³ããŒéã§ã®å ±æã容æã«ãªããŸãã
ãŸããã¯ã©ãŠããµãŒãã¹ã®èªåã¹ã±ãŒãªã³ã°æ©èœãšçµã¿åãããããšã§ããªãœãŒã¹ã®å²ãåœãŠãæé©åããã³ã¹ããæãã€ã€èšç®è² è·ã®é«ãåŠçãå®è¡ããããšãå¯èœã§ããsafetensors ckptã掻çšããããšã«ãããããŒã¿ãµã€ãšã³ã¹ããŒã ã¯ã¯ã©ãŠãäžã®ãªãœãŒã¹ãããå¹ççã«æŽ»çšã§ããããã«ãªãã®ã§ãã
å®å šæ§ãšãã©ã€ãã·ãŒã«ã€ããŠããã¯ã©ãŠããããã€ããŒãæäŸããã»ãã¥ãªãã£ã¡ã«ããºã ãšé£æºããsafetensors ckptãã¡ã€ã«ãä¿è·ããããšãã§ããŸãããã®ããã«ããŠãã¯ã©ãŠãã®åãåããŠãããå®å šãã€å¹ççãªããŒã¿ç®¡çãå®çŸããããšãå¯èœã«ãªããŸãã
5.3 ãšã³ãããŒãšã³ãã®æ©æ¢°åŠç¿ãã€ãã©ã€ã³
safetensors ckptã¯ããšã³ãããŒãšã³ãã®æ©æ¢°åŠç¿ãã€ãã©ã€ã³æ§ç¯ã«ãããŠããã®åœ¹å²ãæãããŸããã¢ãã«ã®ãã¬ãŒãã³ã°ãè©äŸ¡ããããã€ã¡ã³ãã«ããã£ãŠãåã¹ããŒãžã®åºåã確å®ã«èšé²ããäžè²«æ§ã®ããã¯ãŒã¯ãããŒãæäŸããŸãã
ãã®ããŒã«ã䜿çšããããšã§ãããŒã¿ãµã€ãšã³ãã£ã¹ãããšã³ãžãã¢ã¯ã¢ãã«ã®ããã©ãŒãã³ã¹ã«åœ±é¿ãäžããå€æŽã远跡ããããã«å¿ããŠèª¿æŽãè¡ãããšãã§ããŸããããã«ããã¬ãŒãã³ã°ã®é²è¡ã«äŒŽããã©ã¡ãŒã¿ã®ãã¥ãŒãã³ã°ã容æã«ãªããæé©ãªã¢ãã«ãèŠã€ããéçšãããã¹ã ãŒãºã«ãªããŸãã
safetensors ckptãå©çšããããšã«ãããæ©æ¢°åŠç¿ãããžã§ã¯ãã®åçŸæ§ãšéææ§ãåäžããçµæã®ä¿¡é Œæ§ã確ä¿ãããŸããããããè€éãªãã€ãã©ã€ã³ç®¡çã容æã«ããç¶ç¶çãªæ¹åãæ¯æŽããã«ã®ãšãªãã®ã§ãã
5.4 æ¥çå¥ãŠãŒã¹ã±ãŒã¹ã®åæ
safetensors ckptã«ã¯æ§ã ãªæ¥çã§ã®å¿çšäºäŸãååšããããããã®åéã§ç¬èªã®èª²é¡è§£æ±ºã«è²¢ç®ããŠããŸããããšãã°ããã«ã¹ã±ã¢æ¥çã§ã¯ãæ£è ã®å»çèšé²ãå®å šã«ç®¡çããäºæž¬åæãåå¥ã®æ²»çèšç»çå®ã«äœ¿çšãããŠããŸãã
èªåé転è»ã®åéã§ã¯ã倧éã®ã»ã³ãµãŒããŒã¿ãåŠçãããªã¢ã«ã¿ã€ã ã§ã®ææ決å®ãå¯èœã«ããã¢ã«ãŽãªãºã ã®éçºã«è²¢ç®ããŠããŸããsafetensors ckptã®å©çšã«ãããããŒã¿ã®äžè²«æ§ãä¿ã¡ã€ã€ãè»äž¡ã®å®å šæ§ãšæ§èœãåäžãããããšãã§ããŸãã
éèæ¥çã§ã¯ã倧èŠæš¡ãªãã©ã³ã¶ã¯ã·ã§ã³ããŒã¿ãæ±ãéã«ãäžæ£æ€åºããªã¹ã¯ç®¡çã«safetensors ckptã䜿çšãããŠããŸããé«ãã¬ãã«ã®ããŒã¿æŽåæ§ãä¿ã¡ãªãããã»ãã¥ã¢ãªåæç°å¢ãæäŸããããšãå¯èœã§ãããã®ããã«ãå€å²ã«ãããæ¥çã§safetensors ckptã¯éèŠãªåœ¹å²ãæ ã£ãŠãããä»åŸããã®å¿çšç¯å²ã¯æ¡å€§ããŠããããšã§ãããã
6. safetensors ckptã«ãããã¹ããã©ã¯ãã£ã¹
6.1 ããã©ãŒãã³ã¹ãã¥ãŒãã³ã°ã®ãã¯ããã¯
safetensors ckptã䜿çšããéã«ã¯ãããã©ãŒãã³ã¹ãã¥ãŒãã³ã°ãéåžžã«éèŠã§ãããããã®ãã¯ããã¯ã«ã¯ãããŒã¿ã®ååŠçãå¹æçãªã¡ã¢ãªç®¡çãèšç®è³æºã®æé©åãå«ãŸããŸããããŒã¿ããã§ãã¯ãã€ã³ããã©ãŒãããã«å€æããåã«ãäžèŠãªããŒã¿ã®ããªãã³ã°ãæ£èŠåãªã©ãè¡ãããšã§ãã¹ãã¬ãŒãžã®äœ¿çšéãåæžããèªã¿æžãã®ããã©ãŒãã³ã¹ãåäžãããããšãã§ããŸãã
ã¡ã¢ãªäœ¿çšéã®æé©åã¯ãç¹ã«å€§èŠæš¡ãªããŒã¿ã»ãããåãæ±ãéã«äžå¯æ¬ ã§ããé©åãªãããã¡ãªã³ã°ãšéåæI/Oãå©çšããããšã§ãåŠçé床ãé«ããããšãå¯èœã§ããsafetensors ckptãã¡ã€ã«ãèªã¿èŸŒãéã«ã¯ãå¿ èŠãªéšåã®ã¿ãã¡ã¢ãªã«èªã¿èŸŒãããšã§ãªãœãŒã¹ã®å¹ççãªäœ¿çšãå³ããŸãã
ãŸãããã«ãã¹ã¬ããããã«ãããã»ãã·ã³ã°ãããŸã掻çšããããšã§ãèšç®ãªãœãŒã¹ãæ倧éã«æŽ»ããããšãã§ããŸããsafetensors ckptããŒã¿ã®åŠçã«ã¯å€ãã®æŒç®ã䌎ãããã䞊ååŠçæè¡ã掻çšããããšã¯ãå šäœã®ããã©ãŒãã³ã¹åäžã«ç¹ãããŸãã
6.2 ã»ãã¥ã¢ãªããŒã¿æäœã®ã¬ã€ãã©ã€ã³
ã»ãã¥ãªãã£ã¯safetensors ckptãæ±ãäžã§æ¬ ãããªãèŠçŽ ã§ããããŒã¿ãå®å šã«ä¿ã€ããã«ã¯ãé©åãªæå·åæè¡ã®é©çšãäžå¯æ¬ ã§ããããŒã¿ããã£ã¹ã¯ã«ä¿åããéã«ã¯ã匷åºãªæå·åã¢ã«ãŽãªãºã ãçšããŠä¿è·ããããšãæšå¥šãããŸãã
ãŸãããŠãŒã¶ãŒã«ããæäœãå¶éããæš©é管çãéèŠã§ããããŒã å ã§ã®ããŒã¿ã¢ã¯ã»ã¹ã«ã¯å³æ Œãªæš©éèšå®ãè¡ããäžèŠãªããŒã¿ã®æŒæŽ©ãæ¹ç«ãé²ãããšãå¿ èŠã§ããã»ãã¥ãªãã£ããªã·ãŒã®æŽåãšéµå®ããããŒã¿ãå®ãæãåºç€çãªã¹ããããšèšããŸãã
ã»ãã¥ãªãã£ã®è åšã«ã¯åžžã«å¯Ÿå¿ããå¿ èŠããããŸãããã®ãããã»ãã¥ãªãã£ãããã®é©çšããã·ã¹ãã ã®å®æçãªã¢ããããŒããå¿ èŠãšãªããŸããã»ãã¥ãªãã£å¯Ÿçã¯æµåçã§ãããæ°ããªè åšã«è¿ éã«å¯Ÿå¿ããããã®äœå¶ãæ±ããããŸãã
6.3 ã¹ã±ãŒãªã³ã°ãšã¯ã©ã¹ã¿ãªã³ã°æŠç¥
safetensors ckptã®ã¹ã±ãŒãªã³ã°ã¯ãŸããé©åãªããŒã¿ããŒãã£ã·ã§ãã³ã°ããå§ãŸããŸããããŒã¿ãåå²ããè€æ°ã®ããŒãéã§åŠçãåæ£ãããããšã«ãããè² è·ãåçã«åé ããå šäœã®åŠçèœåãåäžãããããšãã§ããŸãã
ã¯ã©ã¹ã¿ãªã³ã°ã¯ç¹ã«èšç®è³æºãéãããŠããå Žåã«å¹æãçºæ®ããŸããå°ããªã¯ã©ã¹ã¿ãŒãå¹ççã«éçšããããšã§ããªãœãŒã¹ãéå°ã«ç¢ºä¿ããå¿ èŠãªããèŠæ±ã«å¿ããã¹ã±ãŒãªã³ã°ãå¯èœã«ãªããŸããããŒããã©ã³ãµãŒã䜿çšããããšã§ãåããŒãã®è² è·ãåçã«ç®¡çããã·ã¹ãã å šäœã®å®å®æ§ãä¿ã€ããšãã§ããŸãã
ã¯ã©ãŠããµãŒãã¹ã掻çšããããšãäžã€ã®è§£ã§ããå€ãã®ã¯ã©ãŠããã©ãããã©ãŒã ã§ã¯ãªãŒãã¹ã±ãŒãªã³ã°ãå¯èœã§ãããéèŠã®å¢æžã«åãããŠãªãœãŒã¹ãæè»ã«èª¿ç¯ã§ããŸãããã®ãããªãµãŒãã¹ãå©çšããããšã§ãã¹ã±ãŒãªã³ã°ã®ã³ã¹ããšè€éããå€§å¹ ã«åæžããããšãå¯èœã§ãã
6.4 ã³ãã¥ããã£ãšãªãŒãã³ãœãŒã¹ãžã®è²¢ç®
safetensors ckptã¯ãªãŒãã³ãœãŒã¹ãããžã§ã¯ããšããŠæé·ããŠããèæ¯ãæã£ãŠããŸããã³ãã¥ããã£ã«è²¢ç®ããããšã¯ããããžã§ã¯ãã®æç¶å¯èœæ§ãšé²åã確å®ã«ããŸãããã°ã®å ±åãæ©èœã®ææ¡ãããã¥ã¡ã³ãã®æ¹åã«ãã£ãŠãå€ãã®äººã ããã®ããŒã«ããã䜿ããããããããšãã§ããŸãã
ã³ãŒãã«çŽæ¥è²¢ç®ããããšããŸããéåžžã«éèŠã§ããå®å®ãããªãªãŒã¹ããµããŒãããããã«ã¯ãæ°ããæ©èœã®éçºã ãã§ãªããã³ãŒãã®ãªãã¡ã¯ã¿ãªã³ã°ãæé©åãå¿ èŠãšãªããŸãããã®ããã«ã¯ãã³ãã¥ããã£ã®ã¡ã³ããŒããã®ã³ãŒãã¬ãã¥ãŒããã£ãŒãããã¯ãæ¬ ãããŸããã
æåŸã«ãã€ãã³ããããŒãã¢ããã®éå¬ã¯ç¥èã®äº€æããããã¯ãŒãã³ã°ã«ãããŠäŸ¡å€ããããŸããsafetensors ckptã«é¢é£ããã»ãããŒãã¯ãŒã¯ã·ã§ãããéããŠãã³ãã¥ããã£ã®ã¡ã³ããŒå士ã®äº€æµãä¿é²ãããããžã§ã¯ãã®èŠéãåºããããšãã§ããŸãã
ãŸãšã
ããžãã¹ããŒãœã³ã®çãããææ°ã®ããŒã¿ç®¡çæè¡ãsafetensors ckptãã«ã€ããŠã玹ä»ããŸãããã®ããŒã«ã¯ãããŒã¿ã»ãã¥ãªãã£ãããã¯ã¢ããæŠç¥ãæ©æ¢°åŠç¿ã®ãããžã§ã¯ãéçšãšãã£ãè€æ°ã®é¢ã§é«ãå¹æãçºæ®ããŸããã€ã³ã¹ããŒã«ããèšå®ãããŒã¿ã»ãã¥ãªãã£ã®ç¢ºä¿ãã¢ãã«ãã¬ãŒãã³ã°ã®æé©åãŸã§ãæ§ã ãªã¹ãããã§é Œãã«ãªããã®æè¡ã¯ãå®è·µçãªããŒã¿ãã³ããªã³ã°ãšãšã³ãããŒãšã³ãã®ãã€ãã©ã€ã³ã匷åããŸããããã«ãããã©ãŒãã³ã¹ãã¥ãŒãã³ã°ããã»ãã¥ã¢ãªããŒã¿æäœãŸã§ãã¹ããã©ã¯ãã£ã¹ãå°å ¥ããæ¥çæ¯ã®ãŠãŒã¹ã±ãŒã¹åæãæ·±ããŠããããšã§ãã客æ§ã®ããžãã¹ã倧ããåã«é²ããããšãã§ããã§ããããå®å šãªããŒã¿ç®¡çã®ããã®ä¿¡é Œæ§ã®é«ãéžæè¢ãsafetensors ckptã«æ¯éã泚ç®ãã ããã