From f0e8421a26b5e63f2e1efd43316e84b50d5cc7eb Mon Sep 17 00:00:00 2001 From: Roshan Venugopal Date: Thu, 16 Nov 2023 09:26:49 -0600 Subject: [PATCH] minor changes. changed the voice narrative. Also added 300 character limits. --- narrator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/narrator.py b/narrator.py index 0435b47..6d25f8d 100644 --- a/narrator.py +++ b/narrator.py @@ -24,7 +24,9 @@ def encode_image(image_path): def play_audio(text): - audio = generate(text=text, voice="ENfvYmv6CRqDodDZTieQ", model="eleven_turbo_v2") + #audio = generate(text=text, voice="ENfvYmv6CRqDodDZTieQ", model="eleven_turbo_v2") + audio = generate(text=text, voice="21m00Tcm4TlvDq8ikWAM", model="eleven_turbo_v2") + unique_id = base64.urlsafe_b64encode(os.urandom(30)).decode("utf-8").rstrip("=") dir_path = os.path.join("narration", unique_id) @@ -59,8 +61,10 @@ def analyze_image(base64_image, script): { "role": "system", "content": """ - You are Sir David Attenborough. Narrate the picture of the human as if it is a nature documentary. + You are a teenager. Narrate the picture as a teenager. Make it snarky and funny. Don't repeat yourself. Make it short. If I do anything remotely interesting, make a big deal about it! + Also do not exceed 300 characters. + take a deep breath and do this step by step. """, }, ]