Skip to content

Commit

Permalink
Merge pull request #171 from L-jasmine/fix/windows
Browse files Browse the repository at this point in the history
[Backend] fix windows
  • Loading branch information
kevinaboos authored Jul 25, 2024
2 parents 5ec46d7 + 8b835e0 commit 30beab9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions moxin-backend/src/backend_impls/api_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl BackendModel for LLamaEdgeApiServer {

let file_id = file.id.to_string();

let url = format!("http://{}/echo", listen_addr);
let url = format!("http://127.0.0.1:{}/echo", listen_addr.port());

let file_ = file.clone();

Expand Down Expand Up @@ -218,7 +218,10 @@ impl BackendModel for LLamaEdgeApiServer {
tx: std::sync::mpsc::Sender<anyhow::Result<ChatResponse>>,
) -> bool {
let is_stream = data.stream.unwrap_or(false);
let url = format!("http://{}/v1/chat/completions", self.listen_addr);
let url = format!(
"http://127.0.0.1:{}/v1/chat/completions",
self.listen_addr.port()
);
let mut cancel = self.running_controller.subscribe();

async_rt.spawn(async move {
Expand Down Expand Up @@ -281,7 +284,7 @@ impl BackendModel for LLamaEdgeApiServer {
}

fn stop(self, _async_rt: &tokio::runtime::Runtime) {
let url = format!("http://{}/admin/exit", self.listen_addr);
let url = format!("http://127.0.0.1:{}/admin/exit", self.listen_addr.port());
let _ = reqwest::blocking::get(url);
let _ = self.model_thread.join();
}
Expand Down

0 comments on commit 30beab9

Please sign in to comment.