Skip to content

Commit

Permalink
BUG: Fix restful client depends on specific type (#1331)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengjieLi28 authored Apr 19, 2024
1 parent 5893d93 commit 5001715
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions xinference/client/restful/restful_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import requests

from ...types import LoRA, PeftModelConfig
from ..common import streaming_response_iterator

if TYPE_CHECKING:
Expand Down Expand Up @@ -866,26 +865,14 @@ def launch_model(

url = f"{self.base_url}/v1/models"

if peft_model_config is not None:
lora_list = [
LoRA.from_dict(model) for model in peft_model_config["lora_list"]
]
peft_model = PeftModelConfig(
lora_list,
peft_model_config["image_lora_load_kwargs"],
peft_model_config["image_lora_fuse_kwargs"],
)
else:
peft_model = None

# convert float to int or string since the RESTful API does not accept float.
if isinstance(model_size_in_billions, float):
model_size_in_billions = convert_float_to_int_or_str(model_size_in_billions)

payload = {
"model_uid": model_uid,
"model_name": model_name,
"peft_model_config": peft_model.to_dict() if peft_model else None,
"peft_model_config": peft_model_config,
"model_type": model_type,
"model_size_in_billions": model_size_in_billions,
"model_format": model_format,
Expand Down

0 comments on commit 5001715

Please sign in to comment.