Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions instill/clients/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, api_token: str = "", async_enabled: bool = False) -> None:
Logger.w("Instill VDP is not serving, VDP functionalities will not work")

self.model_service = ModelClient(
namespace=user_name,
namespace_id=user_name.split("/")[1],
async_enabled=async_enabled,
api_token=api_token,
)
Expand Down Expand Up @@ -101,7 +101,9 @@ def init_model_client(api_token: str = "", async_enabled: bool = False) -> Model
mgmt_service.close()

client = ModelClient(
namespace=user_name, api_token=api_token, async_enabled=async_enabled
namespace_id=user_name.split("/")[1],
api_token=api_token,
async_enabled=async_enabled,
)
if not client.is_serving():
Logger.w("Instill Model is not serving, Model functionalities will not work")
Expand Down
10 changes: 5 additions & 5 deletions instill/clients/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ def __init__(self, stub, url: str, token: str, secure: bool, async_enabled: bool
self.url: str = url
self.token: str = token
self.async_enabled: bool = async_enabled
self.metadata: Union[str, tuple] = ""
self.metadata: list = []

channel_options = (
channel_options = [
("grpc.max_send_message_length", 32 * MB),
("grpc.max_receive_message_length", 32 * MB),
)
]

if not secure:
channel = grpc.insecure_channel(url, options=channel_options)
self.metadata = (
self.metadata = [
(
"authorization",
f"Bearer {token}",
),
)
]
if async_enabled:
async_channel = grpc.aio.insecure_channel(url, options=channel_options)
else:
Expand Down
Loading