From a8c0c50acb88971bde208899c07464fbf8bd9c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ibrahim=20y=C3=B6ndemli?= Date: Tue, 18 Jun 2024 01:37:15 +0300 Subject: [PATCH] Refactor --- ketard.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ketard.py b/ketard.py index 3aa635e..15f7531 100644 --- a/ketard.py +++ b/ketard.py @@ -192,15 +192,14 @@ async def handle_sum_command(bot, message): If its a music video, just write the lyrics. If its a movie, summarize the plot. """ prompt = lmm_prompt + " ".join([item["text"] for item in transcript]) - # summarize response_header = f"**Summarized Video:** `{url}`\n\n" start_time = time.time() - response = response_header + await ollama.invoke(prompt) + ollama_response = await ollama.invoke(prompt) end_time = time.time() generation_time = round(end_time - start_time, 2) model_name = ollama.model - response += f"\n\nTook: `{generation_time}s` | Model: `{model_name}`" + response = f"{response_header}{ollama_response}\n\nTook: `{generation_time}s` | Model: `{model_name}`" await message.reply_text(response, quote=True)