Update t2v_synth_mochi.py
This commit is contained in:
parent
aa30132268
commit
bd844331b2
@ -24,10 +24,13 @@ def patched_write_atomic(
|
|||||||
write_mode = "w" if isinstance(content, str) else "wb"
|
write_mode = "w" if isinstance(content, str) else "wb"
|
||||||
with tmp_path.open(write_mode, encoding="utf-8" if encode_utf_8 else None) as f:
|
with tmp_path.open(write_mode, encoding="utf-8" if encode_utf_8 else None) as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
shutil.copy2(src=tmp_path, dst=path)
|
shutil.copy2(src=tmp_path, dst=path) #to allow overwriting cache files
|
||||||
os.remove(tmp_path)
|
os.remove(tmp_path)
|
||||||
import torch._inductor.codecache
|
try:
|
||||||
torch._inductor.codecache.write_atomic = patched_write_atomic
|
import torch._inductor.codecache
|
||||||
|
torch._inductor.codecache.write_atomic = patched_write_atomic
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user