npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ai-novelist

v1.0.6

Published

https://ai-novel.com のapiを利用するためのモジュール

Downloads

16

Readme

ai-novelist

https://ai-novel.com のapiを利用するためのモジュール

使用法

npm install ai-novelist

基本的な叩き方

import {updateSettings,generateText} from "ai-novelist"
const API_KEY = <API_KEY>;
updateSettings({ API_KEY: API_KEY });

const text = "これはテストです"

const generatedText = await generateText(text);

console.log(generatedText)

追加設定

import {updateSettings,generateText} from "ai-novelist"
const API_KEY = <API_KEY>;
updateSettings({ API_KEY: API_KEY });
const additionalOptions = {
    'length': 20,
    'temperature': 0.8
};

const text = "これはテストです"

const generatedText = await generateText(text,additionalOptions);

console.log(generatedText)

基本的に何も入れない場合

{
    'length': 15,
    'temperature': 0.7,
    'top_p': 0.7,
    'rep_pen': 1.15
}

になる

送ることのできるオプション

{
    'length': 15,				# 出力するトークン数(1~300) 出力が重いと途中で強制終了する場合があります
    'temperature': 0.7,			# ランダム度(0~2.5) 語彙が単調に感じる場合は上げてみてください
    'top_p': 0.7,				# Top Pサンプリング(0.01~1.0) 1より低いほど確率の低いトークンが除外される。極端に関係のない語彙が出ることを防ぎます
    'rep_pen': 1.15,			# 繰り返しペナルティ(1.0~2.0) 値が高すぎると出力が突飛になりすぎる可能性があります
    'top_k': 140,				# Top Kサンプリング(1~500) 上位nトークンのみを採用する
    'top_a': 0.1,				# Top Aサンプリング(0~1.0) 確率が(一番確率の高いトークン^2 * Top A)以下のトークンを除外
    'tailfree': 1.0,			# Tail-freeサンプリング(0.01~1.0) 1より低いほど確率の低いトークンが除外される。やみおとめのみ対応
    'rep_pen_range': 1024,			# 繰り返しペナルティを適用する範囲(0~2048)
    'rep_pen_slope': 3.00,			# 繰り返しペナルティの傾斜(0.01~10)
    'rep_pen_pres': None,			# コンテキスト中に単語が出た回数に依存する繰り返しペナルティ(0~100)
    'typical_p': 1.0,			# Typicalサンプリング(0.01~1.0)
    'badwords': '<unk>',			# 禁止ワードを設定します。<<|>>で区切ります。
    'logit_bias': '【<<|>>_',		# 個別のトークンの出現率を調整します。<<|>>で区切ります。
    'logit_bias_values': '-2.0|-0.1',	# 確率はlogit spaceに作用します。基本的には-5から+5程度が適正です。|で区切ります。設定がおかしいとエラーになります
    'stoptokens': 'トマト<<|>>りんご',	# このシーケンスが生成されると強制的に出力が打ち切られます。<<|>>で区切ります。
    'model': 'damsel',			# damselを指定すると「やみおとめ」モデルが使用できます。デフォルトはsupertrinです。
}