mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-09 19:34:53 +00:00
Some small improvements
This commit is contained in:
parent
b9ae7e5da1
commit
9fbf6032e5
@ -20,7 +20,7 @@ impl ShardedClient {
|
||||
/// the other shards and returns all uris/unix sockets with the `service_discovery` gRPC method.
|
||||
async fn from_master_client(mut master_client: Client) -> Result<Self> {
|
||||
// Get all uris/unix sockets from the master client
|
||||
let uris = master_client.service_discovery().await.unwrap();
|
||||
let uris = master_client.service_discovery().await?;
|
||||
let futures = uris.into_iter().map(Client::connect_uds);
|
||||
let clients: Result<Vec<Client>> = join_all(futures).await.into_iter().collect();
|
||||
Ok(Self::new(clients?))
|
||||
|
@ -4,6 +4,8 @@ use text_generation_client::{
|
||||
Batch, NextTokenChooserParameters, Request, ShardedClient, StoppingCriteriaParameters,
|
||||
};
|
||||
|
||||
const LIVENESS_ID: u64 = u64::MAX;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) struct Health {
|
||||
client: ShardedClient,
|
||||
@ -27,7 +29,7 @@ impl Health {
|
||||
|
||||
// Dummy batch of 1 token and 1 generated token
|
||||
let liveness_request = Request {
|
||||
id: u64::MAX,
|
||||
id: LIVENESS_ID,
|
||||
inputs: "liveness".to_string(),
|
||||
truncate: 10,
|
||||
parameters: Some(NextTokenChooserParameters {
|
||||
|
Loading…
Reference in New Issue
Block a user