From 6bbb72e7880a01cf4ae33a85f6d0e9f4e5c45c11 Mon Sep 17 00:00:00 2001 From: Animesh Kumar Date: Sun, 7 May 2023 08:04:32 +0530 Subject: [PATCH] make the desired changes as said here -> https://github.com/X-PLUG/mPLUG-Owl/issues/22#issue-1698528874 --- apex_22.01_pp/csrc/mlp.cpp | 4 ++-- interface.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apex_22.01_pp/csrc/mlp.cpp b/apex_22.01_pp/csrc/mlp.cpp index 68cf174..830d606 100644 --- a/apex_22.01_pp/csrc/mlp.cpp +++ b/apex_22.01_pp/csrc/mlp.cpp @@ -62,7 +62,7 @@ std::vector mlp_forward(int use_bias, int activation, std::vector(reserved_size)}, inputs[0].type()); // allocate fixed 4MB workspace for cublaslt for now, and this gets at least 4 MB auto lt_workspace = at::empty({1 << 22}, inputs[0].type()); @@ -135,7 +135,7 @@ std::vector mlp_backward( get_mlp_bp_workspace_in_bytes(batch_size, num_layers, output_features.data()); // auto work_space = at::empty({work_size*4}, at::kByte); - auto work_space = at::empty({work_size / sizeof(scalar_t)}, inputs[0].type()); + auto work_space = at::empty({static_cast(work_size / sizeof(scalar_t))}, inputs[0].type()); auto result = mlp_bp( inputs[0].data_ptr(), diff --git a/interface.py b/interface.py index 8ecb5f8..fdfb7c9 100644 --- a/interface.py +++ b/interface.py @@ -30,8 +30,8 @@ def get_model(checkpoint_path=None, tokenizer_path=None, peft_config=None, devic tokenizer.eod_id = tokenizer.eos_token_id img_processor = ImageProcessor() - model = model.to(device) model = model.to(dtype) + model = model.to(device) return model, tokenizer, img_processor