praeclarum / transformers-js

Browser-compatible JS library for running language models
MIT License
223 stars 17 forks source link

Model giving extremely short prompts #6

Open VatsaDev opened 1 year ago

VatsaDev commented 1 year ago

I have this code

import { pipeline } from "https://cdn.jsdelivr.net/npm/@xenova/transformers@2.3.0";

      let storyTeller = await pipeline(
        "text2text-generation",
      );

      async function story() {
        let result = await storyTeller("give a story on XXX", { // example
          min_new_tokens: 1000,
          temperature: 0.6,
          repetition_penalty: 5,
          no_repeat_ngram_size: 1,
        });

        console.log(result);
        document.getElementById("output").innerHTML = result;
      }

However this often gives me one word or a sentence at best, even if I set min_new_token to 2000 or more. Why is that?