INNER CODE UNIT · Rust
write_executor_script
EricLBuehler/mistral.rs · mistralrs-code-exec/src/lib.rs:237
fn write_executor_script() -> anyhow::Result<(Arc<tempfile::TempDir>, PathBuf)> {
let executor_dir = Arc::new(
tempfile::Builder::new()
.prefix("mistralrs-executor-")
.tempdir()?,
);
let executor_script = executor_dir.path().join("executor.py");
std::fs::write(&executor_script, EXECUTOR_PY)?;
Ok((executor_dir, executor_script))
}
async fn validate_python(python_path: &Path) -> anyhow::Result<()> {
let output = tokio::process::Command::new(python_path)
.arg("--version")
.output()
.await
.map_err(|e| {
anyhow::anyhow!(