node: fix option names for `BPE.fromFiles`
@@ -53,12 +53,12 @@ declare_types! {
}
}
-/// bpe_from_files(vocab: String, merges: String, options?: {
-/// cache_capacity?: number,
+/// bpe_from_files(vocab: String, merges: String, options: {
+/// cacheCapacity?: number,
/// dropout?: number,
-/// unk_token?: String,
-/// continuing_subword_prefix?: String,
-/// end_of_word_suffix?: String
+/// unkToken?: String,
+/// continuingSubwordPrefix?: String,
+/// endOfWordSuffix?: String
/// })
pub fn bpe_from_files(mut cx: FunctionContext) -> JsResult<JsModel> {
let vocab = cx.argument::<JsString>(0)?.value() as String;
@@ -70,7 +70,7 @@ pub fn bpe_from_files(mut cx: FunctionContext) -> JsResult<JsModel> {
if let Some(options) = options {
if let Ok(options) = options.downcast::<JsObject>() {
- if let Ok(cache_capacity) = options.get(&mut cx, "cache_capacity") {
+ if let Ok(cache_capacity) = options.get(&mut cx, "cacheCapacity") {
if let Err(_) = cache_capacity.downcast::<JsUndefined>() {
let cache_capacity = cache_capacity
.downcast::<JsNumber>()
@@ -85,20 +85,20 @@ pub fn bpe_from_files(mut cx: FunctionContext) -> JsResult<JsModel> {
builder = builder.dropout(dropout);
}
}
- if let Ok(unk_token) = options.get(&mut cx, "unk_token") {
+ if let Ok(unk_token) = options.get(&mut cx, "unkToken") {
if let Err(_) = unk_token.downcast::<JsUndefined>() {
let unk_token =
unk_token.downcast::<JsString>().or_throw(&mut cx)?.value() as String;
builder = builder.unk_token(unk_token);
}
}
- if let Ok(prefix) = options.get(&mut cx, "continuing_subword_prefix") {
+ if let Ok(prefix) = options.get(&mut cx, "continuingSubwordPrefix") {
if let Err(_) = prefix.downcast::<JsUndefined>() {
let prefix = prefix.downcast::<JsString>().or_throw(&mut cx)?.value() as String;
builder = builder.continuing_subword_prefix(prefix);
}
}
- if let Ok(suffix) = options.get(&mut cx, "end_of_word_suffix") {
+ if let Ok(suffix) = options.get(&mut cx, "endOfWordSuffix") {
if let Err(_) = suffix.downcast::<JsUndefined>() {
let suffix = suffix.downcast::<JsString>().or_throw(&mut cx)?.value() as String;
builder = builder.end_of_word_suffix(suffix);
