From 224a77ab5f73e41894627973a831c656df17c0b3 Mon Sep 17 00:00:00 2001
From: Andres Marafioti <andimarafioti@gmail.com>
Date: Wed, 21 Aug 2024 16:02:37 +0200
Subject: [PATCH] don't break if this global doesn't exist

---
 s2s_pipeline.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/s2s_pipeline.py b/s2s_pipeline.py
index 90681f2..ebf36ed 100644
--- a/s2s_pipeline.py
+++ b/s2s_pipeline.py
@@ -867,7 +867,7 @@ class ParlerTTSHandler(BaseHandler):
         thread.start()
 
         for i, audio_chunk in enumerate(streamer):
-            if i == 0:
+            if i == 0 and 'pipeline_start' in globals():
                 logger.info(
                     f"Time to first audio: {perf_counter() - pipeline_start:.3f}"
                 )
-- 
GitLab