Skip to content

Commit

Permalink
feat: support emoji for timestamp mode
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Mar 13, 2023
1 parent 722377b commit b0b62b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion components/PromptOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function PromptOptions({
<input
type="checkbox"
className="peer sr-only"
disabled={shouldShowTimestamp}
{...register("showEmoji")}
/>
<div className="peer h-6 w-11 rounded-full bg-gray-200 after:absolute after:top-[2px] after:left-[2px] after:h-5 after:w-5 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-sky-400 peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-sky-300 dark:border-gray-600 dark:bg-gray-700 dark:peer-focus:ring-sky-800"></div>
Expand Down
3 changes: 2 additions & 1 deletion lib/openai/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ export function getUserSubtitleWithTimestampPrompt(
.trim();
const language = videoConfig.outputLanguage || 'Chinese';
const sentenceCount = videoConfig.sentenceNumber || 7;
const emojiTemplateText = videoConfig.showEmoji ? "[Emoji] " : ""
const wordsCount = videoConfig.detailLevel ? (Number(videoConfig.detailLevel)/10)*2 : 15;
const promptWithTimestamp = `Act as the author and provide exactly ${sentenceCount} bullet points all in ${language} language for the text transcript given in the format [seconds] - [text] \nMake sure that:\n - Please start by summarizing the whole video in one short sentence\n - Then, please summarize with each bullet_point is at least ${wordsCount} words\n - each bullet_point start with \"- \" or a number or a bullet point symbol\n - each bullet_point should has the start timestamp, e.g. seconds - [Emoji] [bullet_point]\n - there may be typos in the subtitles, please correct them`;
const promptWithTimestamp = `Act as the author and provide exactly ${sentenceCount} bullet points all in ${language} language for the text transcript given in the format [seconds] - [text] \nMake sure that:\n - Please start by summarizing the whole video in one short sentence\n - Then, please summarize with each bullet_point is at least ${wordsCount} words\n - each bullet_point start with \"- \" or a number or a bullet point symbol\n - each bullet_point should has the start timestamp, use this template: - seconds - ${emojiTemplateText}[bullet_point]\n - there may be typos in the subtitles, please correct them`;
const videoTranscripts = limitTranscriptByteLength(
JSON.stringify(videoTranscript)
);
Expand Down

1 comment on commit b0b62b6

@vercel
Copy link

@vercel vercel bot commented on b0b62b6 Mar 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please # to comment.