Skip to content

Commit 6b2bf8a

Browse files
authored
fix: update output path (#83)
1 parent 1d0f0dc commit 6b2bf8a

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

docs/reference/encoderfile_util_cli.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Build an encoderfile.
2727

2828
###### **Options:**
2929

30-
* `-f <CONFIG>` — Path to config file.
31-
* `-o`, `--output-path <OUTPUT_PATH>` — Output path (e.g., `./my_model.encoderfile`)
32-
* `--cache-dir <CACHE_DIR>` — Cache directory. This is used for build artifacts.
33-
* `--no-build` — Skips build stage. Only generates files to directory in `cache_dir`.
30+
* `-f <CONFIG>` — Path to config file. Required.
31+
* `-o`, `--output-path <OUTPUT_PATH>` — Output path, e.g., `./my_model.encoderfile`. Optional
32+
* `--cache-dir <CACHE_DIR>` — Cache directory. This is used for build artifacts. Optional.
33+
* `--no-build` — Skips build stage. Only generates files to directory in `cache_dir`. Defaults to False.
3434

3535

3636

encoderfile/src/config.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub struct EncoderfileConfig {
3131
pub version: String,
3232
pub path: ModelPath,
3333
pub model_type: ModelType,
34-
#[serde(default = "default_output_dir")]
34+
#[serde(default = "default_output_path")]
3535
pub output_path: PathBuf,
3636
#[serde(default = "default_cache_dir")]
3737
pub cache_dir: PathBuf,
@@ -135,9 +135,10 @@ impl ModelPath {
135135
asset_path!(model_weights_path, "model.onnx", "model weights");
136136
}
137137

138-
fn default_output_dir() -> PathBuf {
138+
fn default_output_path() -> PathBuf {
139139
std::env::current_dir()
140140
.expect("Can't even find the current dir? Tragic. (no seriously please open an issue)")
141+
.join("model.encoderfile")
141142
}
142143

143144
fn default_cache_dir() -> PathBuf {

schemas/encoderfile-config-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"output_path": {
3232
"type": "string",
33-
"default": "/Users/rbesaleli/encoderfile"
33+
"default": "/Users/rbesaleli/encoderfile/model.encoderfile"
3434
},
3535
"path": {
3636
"$ref": "#/$defs/ModelPath"

test_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ encoderfile:
22
name: my-model-2
33
path: models/token_classification
44
model_type: token_classification
5-
output_dir: .
5+
output_dir: ./my-model-2.encoderfile
66
transform:
77
path: transforms/token_classification/softmax_logits.lua

0 commit comments

Comments
 (0)