mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-01 12:06:37 +08:00
Avoid importing private function
This commit is contained in:
parent
12d1e968cc
commit
834c087479
@ -8,7 +8,8 @@ import time
|
||||
import uuid
|
||||
import warnings
|
||||
from dataclasses import dataclass, field
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer, _get_best_family
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||
import socket
|
||||
from pathlib import Path
|
||||
from typing import (
|
||||
Any,
|
||||
@ -694,7 +695,7 @@ def run(
|
||||
):
|
||||
server_address = (host, port)
|
||||
prompt_cache = PromptCache()
|
||||
server_class.address_family, server_address = _get_best_family(*server_address)
|
||||
server_class.address_family, _, _, _, server_address = next(iter(socket.getaddrinfo(*server_address, type=socket.SOCK_STREAM, flags=socket.AI_PASSIVE)))
|
||||
httpd = server_class(
|
||||
server_address,
|
||||
lambda *args, **kwargs: handler_class(
|
||||
|
Loading…
Reference in New Issue
Block a user