Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
meenchen committed May 23, 2023
1 parent 0c9d325 commit f5f3d6c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions experimental/transformer/model_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def export_W8A8B8O8Linear(op, prefix):
f.write(op.weight.cpu().numpy().tobytes())
with open(os.path.join(f"{outpath}", "bias.bin"), "wb") as f:
f.write((op.bias.cpu().float() * (op.b.item() / op.a.item())).round().int().numpy().tobytes())
with open(os.path.join(f"{outpath}", "bias_int8.bin"), "wb") as f:
f.write((op.bias.cpu().numpy().tobytes()))
with open(os.path.join(f"{outpath}", "alpha.bin"), "wb") as f:
f.write(op.a.cpu().float().numpy().tobytes())
with open(os.path.join(f"{outpath}", "beta.bin"), "wb") as f:
Expand Down
2 changes: 1 addition & 1 deletion experimental/transformer/src/OPTGenerate.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "OPTGenerate.h"

#include "common.h"
#include "util.h"
#include "utils.h"

void OPT_sample_repetition_penalty(OPT_token_data_array* candidates, const int* last_tokens, size_t last_tokens_size,
float penalty) {
Expand Down
5 changes: 2 additions & 3 deletions experimental/transformer/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ def subebackups(file_path, target_path, token):
dbx.files_upload(f.read(), dest_path)

else:

upload_session_start_result = dbx.files_upload_session_start(f.read(CHUNK_SIZE))
cursor = dropbox.files.UploadSessionCursor(
session_id=upload_session_start_result.session_id, offset=f.tell()
)
commit = dropbox.files.CommitInfo(path=dest_path)
commit = dropbox.files.CommitInfo(path=dest_path, mode=dropbox.files.WriteMode("overwrite"))

while f.tell() < file_size:
if (file_size - f.tell()) <= CHUNK_SIZE:
Expand All @@ -35,5 +34,5 @@ def subebackups(file_path, target_path, token):
parser.add_argument("token", help="Your Dropbox OAuth2 token.")
args = parser.parse_args()

subebackups("assets.zip", "/MIT/transformer_assets/assets_test.zip", args.token)
subebackups("assets.zip", "/MIT/transformer_assets/assets.zip", args.token)
subebackups("models.zip", "/MIT/transformer_assets/models.zip", args.token)

0 comments on commit f5f3d6c

Please sign in to comment.