File size: 585 Bytes
20f348c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os

from core.model_runtime.model_providers.gpustack.tts.tts import GPUStackText2SpeechModel


def test_invoke_model():
    model = GPUStackText2SpeechModel()

    result = model.invoke(
        model="cosyvoice-300m-sft",
        tenant_id="test",
        credentials={
            "endpoint_url": os.environ.get("GPUSTACK_SERVER_URL"),
            "api_key": os.environ.get("GPUSTACK_API_KEY"),
        },
        content_text="Hello world",
        voice="Chinese Female",
    )

    content = b""
    for chunk in result:
        content += chunk

    assert content != b""