33
33
from huggingface_hub .inference ._providers .hyperbolic import HyperbolicTextGenerationTask , HyperbolicTextToImageTask
34
34
from huggingface_hub .inference ._providers .nebius import NebiusFeatureExtractionTask , NebiusTextToImageTask
35
35
from huggingface_hub .inference ._providers .novita import NovitaConversationalTask , NovitaTextGenerationTask
36
- from huggingface_hub .inference ._providers .nscale import NscaleChatCompletion , NscaleTextToImageTask
36
+ from huggingface_hub .inference ._providers .nscale import NscaleConversationalTask , NscaleTextToImageTask
37
37
from huggingface_hub .inference ._providers .openai import OpenAIConversationalTask
38
38
from huggingface_hub .inference ._providers .replicate import ReplicateTask , ReplicateTextToSpeechTask
39
39
from huggingface_hub .inference ._providers .sambanova import SambanovaConversationalTask , SambanovaFeatureExtractionTask
@@ -858,7 +858,7 @@ def test_prepare_route_text_to_image(self):
858
858
assert helper ._prepare_route ("model_name" , "api_key" ) == "/v1/images/generations"
859
859
860
860
def test_prepare_route_chat_completion (self ):
861
- helper = NscaleChatCompletion ()
861
+ helper = NscaleConversationalTask ()
862
862
assert helper ._prepare_route ("model_name" , "api_key" ) == "/v1/chat/completions"
863
863
864
864
def test_prepare_payload_with_size_conversion (self ):
@@ -869,7 +869,12 @@ def test_prepare_payload_with_size_conversion(self):
869
869
"width" : 512 ,
870
870
"height" : 512 ,
871
871
},
872
- "stabilityai/stable-diffusion-xl-base-1.0" ,
872
+ InferenceProviderMapping (
873
+ hf_model_id = "stabilityai/stable-diffusion-xl-base-1.0" ,
874
+ providerId = "stabilityai/stable-diffusion-xl-base-1.0" ,
875
+ task = "text-to-image" ,
876
+ status = "live" ,
877
+ ),
873
878
)
874
879
assert payload == {
875
880
"prompt" : "a beautiful landscape" ,
@@ -888,7 +893,12 @@ def test_prepare_payload_as_dict(self):
888
893
"cfg_scale" : 7.5 ,
889
894
"num_inference_steps" : 50 ,
890
895
},
891
- "stabilityai/stable-diffusion-xl-base-1.0" ,
896
+ InferenceProviderMapping (
897
+ hf_model_id = "stabilityai/stable-diffusion-xl-base-1.0" ,
898
+ providerId = "stabilityai/stable-diffusion-xl-base-1.0" ,
899
+ task = "text-to-image" ,
900
+ status = "live" ,
901
+ ),
892
902
)
893
903
assert "width" not in payload
894
904
assert "height" not in payload
0 commit comments