ModerRAS commited on
Commit
74e919a
·
1 Parent(s): b689df8

Use direct local HTTP for LM Studio reviewer

Browse files
tools/rust_dmhy_template_apply/README.md CHANGED
@@ -62,7 +62,7 @@ cargo run --release --manifest-path tools\rust_dmhy_template_apply\Cargo.toml --
62
  --review-title-boundaries-lmstudio `
63
  --recipes reports\dmhy_template_recipes.full_top5000.seed.jsonl `
64
  --title-boundary-decisions-output reports\dmhy_title_boundary_lmstudio_decisions.jsonl `
65
- --lmstudio-base-url http://localhost:1234/v1 `
66
  --lmstudio-model qwen `
67
  --title-boundary-min-similarity 0.25 `
68
  --title-boundary-max-similarity 0.85 `
 
62
  --review-title-boundaries-lmstudio `
63
  --recipes reports\dmhy_template_recipes.full_top5000.seed.jsonl `
64
  --title-boundary-decisions-output reports\dmhy_title_boundary_lmstudio_decisions.jsonl `
65
+ --lmstudio-base-url http://127.0.0.1:1234/v1 `
66
  --lmstudio-model qwen `
67
  --title-boundary-min-similarity 0.25 `
68
  --title-boundary-max-similarity 0.85 `
tools/rust_dmhy_template_apply/src/main.rs CHANGED
@@ -64,7 +64,7 @@ struct Args {
64
  default_value = "reports/dmhy_title_boundary_lmstudio_decisions.jsonl"
65
  )]
66
  title_boundary_decisions_output: PathBuf,
67
- #[arg(long, default_value = "http://localhost:1234/v1")]
68
  lmstudio_base_url: String,
69
  #[arg(long, default_value = "qwen")]
70
  lmstudio_model: String,
@@ -1379,7 +1379,7 @@ fn call_lmstudio_title_boundary(
1379
  fn post_json_http(endpoint: &str, body: &Value, timeout_seconds: u64) -> Result<Value> {
1380
  let (host, port, path) = parse_http_endpoint(endpoint)?;
1381
  let host_port = format!("{host}:{port}");
1382
- let mut stream = std::net::TcpStream::connect((&*host, port))
1383
  .with_context(|| format!("failed to connect to {host_port}"))?;
1384
  let timeout = std::time::Duration::from_secs(timeout_seconds);
1385
  stream.set_read_timeout(Some(timeout))?;
 
64
  default_value = "reports/dmhy_title_boundary_lmstudio_decisions.jsonl"
65
  )]
66
  title_boundary_decisions_output: PathBuf,
67
+ #[arg(long, default_value = "http://127.0.0.1:1234/v1")]
68
  lmstudio_base_url: String,
69
  #[arg(long, default_value = "qwen")]
70
  lmstudio_model: String,
 
1379
  fn post_json_http(endpoint: &str, body: &Value, timeout_seconds: u64) -> Result<Value> {
1380
  let (host, port, path) = parse_http_endpoint(endpoint)?;
1381
  let host_port = format!("{host}:{port}");
1382
+ let mut stream = std::net::TcpStream::connect(&host_port)
1383
  .with_context(|| format!("failed to connect to {host_port}"))?;
1384
  let timeout = std::time::Duration::from_secs(timeout_seconds);
1385
  stream.set_read_timeout(Some(timeout))?;