Skip to content

Commit

Permalink
Add warmup demo
Browse files Browse the repository at this point in the history
  • Loading branch information
WeberJulian committed Dec 13, 2023
1 parent 2af0f0a commit 29c4a06
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ def tts(text, speaker_type, speaker_name_studio, speaker_name_custom, lang):
)

if __name__ == "__main__":
print("Warming up server...")
with open("test/default_speaker.json", "r") as fp:
warmup_speaker = json.load(fp)
resp = requests.post(
SERVER_URL + "/tts",
json={
"text": "This is a warmup request.",
"language": "en",
"speaker_embedding": warmup_speaker["speaker_embedding"],
"gpt_cond_latent": warmup_speaker["gpt_cond_latent"],
}
)
resp.raise_for_status()
print("Starting the demo...")
demo.launch(
share=False,
debug=False,
Expand Down

0 comments on commit 29c4a06

Please sign in to comment.