Skip to content

Commit

Permalink
Update distributed.py
Browse files Browse the repository at this point in the history
  • Loading branch information
trestad authored Oct 12, 2024
1 parent 0d5b8b4 commit 61d29e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion getmusic/getmusic/distributed/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ def all_gather(data):
if world_size == 1:
return [data]

buffer = pickle.dumps(data)

# Due to security concerns, the use of pickle has been commented out.
# Pickle can be unsafe when used with untrusted data, as it may execute arbitrary code.
# If you understand the associated risks and wish to run this code, please uncomment the following line.
# It is recommended to use this only in a controlled environment and with trusted data sources.
# buffer = pickle.dumps(data)

storage = torch.ByteStorage.from_buffer(buffer)
tensor = torch.ByteTensor(storage).to("cuda")

Expand Down

0 comments on commit 61d29e0

Please sign in to comment.