File size: 718 Bytes
07ae658
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
import { HfInference } from '@huggingface/inference'

const hf = new HfInference(process.env.WEBTV_HF_API_TOKEN)

const model = 'OpenAssistant/oasst-sft-4-pythia-12b-epoch-3.5'

export const getVideoPrompt = async (seed: string) => {
  const inputs = `<|prompter|>Can you propose a caption for a new video, that we could display after the first one? Here's the caption for the first video: "${seed}"<|endoftext|><|assistant|>The best caption would be:`

  const { generated_text } = await hf.textGeneration({
    model,
    inputs,
    parameters: {
      max_new_tokens: 50,
      return_full_text: false,
      // temperature: 0.3,
    }
  })
  
  return generated_text.split(/[#\[\]]/)[0].replace('"', '')
}

*/