Minor tweaks.

This commit is contained in:
laurent
2023-07-03 18:31:55 +01:00
parent 3905de4169
commit 9784d1ed9f
2 changed files with 5 additions and 1 deletions

View File

@ -594,7 +594,8 @@ fn main() -> Result<()> {
Device::new_cuda(0)?
};
let tokenizer = Tokenizer::from_file(args.tokenizer_config).map_err(E::msg)?;
let mut tokenizer = Tokenizer::from_file(args.tokenizer_config).map_err(E::msg)?;
let tokenizer = tokenizer.with_padding(None).with_truncation(None);
let weights = unsafe { candle::safetensors::MmapedFile::new(args.weights)? };
let weights = weights.deserialize()?;

View File

@ -1,4 +1,5 @@
#include "cuda_utils.cuh"
#include<stdint.h>
#define UNARY_OP(TYPENAME, FN_NAME, FUNC) \
extern "C" __global__ void FN_NAME( \
@ -68,6 +69,8 @@ UNARY_OP(__half, ugelu_f16, gelu_fwd(x))
UNARY_OP(__half, urelu_f16, relu_fwd(x))
#endif
UNARY_OP(uint8_t, ucopy_u8, x)
UNARY_OP(uint32_t, ucopy_u32, x)
UNARY_OP(float, ucopy_f32, x)
UNARY_OP(double, ucopy_f64, x)
UNARY_OP(float, uneg_f32, -x)