Skip to content

Commit

Permalink
Merge pull request #19 from nbcstevenchen/main
Browse files Browse the repository at this point in the history
Add the full path of prompt files
  • Loading branch information
rootfs authored May 18, 2024
2 parents 6e34862 + 78fa39b commit fd48239
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cncf-youtube-channel-summarizer/transcript_summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def create_models(self):
def LLM_summarizer(self, llm_summary, llm_keywords, transcript, chunk_size, chunk_overlap, key):
text_splitter = RecursiveCharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
texts = text_splitter.create_documents([transcript])
map_summary_template = open('prompt/chunks_summary_prompt.txt').readlines()
map_summary_template = open('cncf-youtube-channel-summarizer/prompt/chunks_summary_prompt.txt').readlines()
map_summary_template = ''.join(map_summary_template)
combine_summary_template = open('prompt/combine_summary_prompt.txt').readlines()
combine_summary_template = open('cncf-youtube-channel-summarizer/prompt/combine_summary_prompt.txt').readlines()
combine_summary_template = ''.join(combine_summary_template)

keyword_template = open('prompt/keyword_template.txt').readlines()
keyword_template = open('cncf-youtube-channel-summarizer/prompt/keyword_template.txt').readlines()
keyword_template = ''.join(keyword_template)

map_prompt = PromptTemplate(template=map_summary_template, input_variables=["text"])
Expand Down Expand Up @@ -85,8 +85,7 @@ def run(self):
logger.error(f"{e}")
missed_video_id = open('cncf-youtube-channel-summarizer/data/missed_video_id.txt', 'a')
missed_video_id.write(key+',')
#continue
break
continue

data = {'video_id': [key], 'video_title': [self.videos_dict[key]['video_title']],
'conference_name': [self.videos_dict[key]['play_list']['title']], 'summary': [summary],
Expand Down

0 comments on commit fd48239

Please sign in to comment.