From 0282d4fca5e458313adad40da8f25720581ecc71 Mon Sep 17 00:00:00 2001 From: Gokul Mohanarangan Date: Fri, 14 Jul 2023 23:04:44 +0530 Subject: [PATCH] remove key --- trials/finetune.py | 0 trials/openai_endpoint.py | 12 +++++++++--- trials/youtube_scraping.py | 0 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 trials/finetune.py create mode 100644 trials/youtube_scraping.py diff --git a/trials/finetune.py b/trials/finetune.py new file mode 100644 index 00000000..e69de29b diff --git a/trials/openai_endpoint.py b/trials/openai_endpoint.py index 6fb0f56a..30e6a900 100644 --- a/trials/openai_endpoint.py +++ b/trials/openai_endpoint.py @@ -3,7 +3,7 @@ import openai -openai.api_key = "***REMOVED***" +openai.api_key = "" # to caption, user prompt used : "caption this conversation" # max_tokens=20 @@ -21,10 +21,16 @@ conversation = [ "content": "summarize this conversation in a few sentences by taking key points"} ] -response = openai.ChatCompletion.create(model="gpt-3.5-turbo", +model = "gpt-3.5-turbo" +response = openai.ChatCompletion.create(model=model, messages=conversation, n=1, max_tokens=300) -caption = response.choices[0].message.content.strip() +# Try finetuned model +# model = "davinci:ft-personal-2023-07-14-10-43-51" +# response = openai.Completion.create(model=model, +# prompt=sample_chunks[0] + " -> ") + +caption = response.choices[0] print(caption) diff --git a/trials/youtube_scraping.py b/trials/youtube_scraping.py new file mode 100644 index 00000000..e69de29b