Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nlpcloud

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nlpcloud - npm Package Compare versions

Comparing version 1.0.47 to 1.0.48

9

dist/index.d.ts

@@ -90,3 +90,2 @@ export = Client;

generation(text: string,
minLength?: number,
maxLength?: number,

@@ -96,6 +95,3 @@ lengthNoInput?: boolean,

removeInput?: boolean,
doSample?: boolean,
numBeams?: number,
earlyStopping?: boolean,
noRepeatNgramSize?: number,
numReturnSequences?: number,

@@ -106,6 +102,3 @@ topK?: number,

repetitionPenalty?: number,
lengthPenalty?: number,
badWords?: string[],
removeEndSequence?: boolean,
isInstruct?: boolean): Promise<{
removeEndSequence?: boolean): Promise<{
status: number;

@@ -112,0 +105,0 @@ statusText: string;

18

index.js

@@ -113,10 +113,9 @@ const axios = require('axios')

generation(text, minLength = null, maxLength = null, lengthNoInput = null,
endSequence = null, removeInput = null, doSample = null, numBeams = null, earlyStopping = null,
noRepeatNgramSize = null, numReturnSequences = null, topK = null, topP = null,
temperature = null, repetitionPenalty = null, lengthPenalty = null, badWords = null, removeEndSequence = null,
isInstruct= null) {
generation(text, maxLength = null, lengthNoInput = null,
endSequence = null, removeInput = null, numBeams = null,
numReturnSequences = null, topK = null, topP = null,
temperature = null, repetitionPenalty = null, badWords = null,
removeEndSequence = null) {
const payload = {
'text': text,
'min_length': minLength,
'max_length': maxLength,

@@ -126,6 +125,3 @@ 'length_no_input': lengthNoInput,

'remove_input': removeInput,
'do_sample': doSample,
'num_beams': numBeams,
'early_stopping': earlyStopping,
'no_repeat_ngram_size': noRepeatNgramSize,
'num_return_sequences': numReturnSequences,

@@ -136,6 +132,4 @@ 'top_k': topK,

'repetition_penalty': repetitionPenalty,
'length_penalty': lengthPenalty,
'bad_words': badWords,
'remove_end_sequence': removeEndSequence,
'is_instruct': isInstruct
'remove_end_sequence': removeEndSequence
};

@@ -142,0 +136,0 @@

{
"name": "nlpcloud",
"version": "1.0.47",
"version": "1.0.48",
"description": "NLP Cloud serves high performance pre-trained or custom models for NER, sentiment-analysis, classification, summarization, paraphrasing, text generation, image generation, code generation, question answering, automatic speech recognition, machine translation, language detection, semantic search, semantic similarity, tokenization, POS tagging, speech synthesis, embeddings, and dependency parsing. It is ready for production, served through a REST API.\n\nThis is the Node.js client for the NLP Cloud API.\n\nMore details here: https://nlpcloud.io\n\nDocumentation: https://docs.nlpcloud.io",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -249,3 +249,2 @@ # Node.js Client For NLP Cloud

1. The block of text that starts the generated text. 256 tokens maximum for GPT-J on CPU, 1024 tokens maximum for GPT-J and GPT-NeoX 20B on GPU, and 2048 tokens maximum for Fast GPT-J and Finetuned GPT-NeoX 20B on GPU.
1. (Optional) `minLength`: The minimum number of tokens that the generated text should contain. 256 tokens maximum for GPT-J on CPU, 1024 tokens maximum for GPT-J and GPT-NeoX 20B on GPU, and 2048 tokens maximum for Fast GPT-J and Finetuned GPT-NeoX 20B on GPU.. If `lengthNoInput` is false, the size of the generated text is the difference between `minLength` and the length of your input text. If `lengthNoInput` is true, the size of the generated text simply is `minLength`. Defaults to 10.
1. (Optional) `maxLength`: Optional. The maximum number of tokens that the generated text should contain. 256 tokens maximum for GPT-J on CPU, 1024 tokens maximum for GPT-J and GPT-NeoX 20B on GPU, and 2048 tokens maximum for Fast GPT-J and Finetuned GPT-NeoX 20B on GPU. If `lengthNoInput` is false, the size of the generated text is the difference between `maxLength` and the length of your input text. If `lengthNoInput` is true, the size of the generated text simply is `maxLength`. Defaults to 50.

@@ -255,6 +254,3 @@ 1. (Optional) `lengthNoInput`: Whether `minLength` and `maxLength` should not include the length of the input text, as a boolean. If false, `minLength` and `maxLength` include the length of the input text. If true, min_length and `maxLength` don't include the length of the input text. Defaults to false.

1. (Optional) `removeInput`: Whether you want to remove the input text form the result, as a boolean. Defaults to false.
1. (Optional) `doSample`: Whether or not to use sampling ; use greedy decoding otherwise, as a boolean. Defaults to true.
1. (Optional) `numBeams`: Number of beams for beam search. 1 means no beam search. This is an integer. Defaults to 1.
1. (Optional) `earlyStopping`: Whether to stop the beam search when at least num_beams sentences are finished per batch or not, as a boolean. Defaults to false.
1. (Optional) `noRepeatNgramSize`: If set to int > 0, all ngrams of that size can only occur once. This is an integer. Defaults to 0.
1. (Optional) `numReturnSequences`: The number of independently computed returned sequences for each element in the batch, as an integer. Defaults to 1.

@@ -265,3 +261,2 @@ 1. (Optional) `topK`: The number of highest probability vocabulary tokens to keep for top-k-filtering, as an integer. Maximum 1000 tokens. Defaults to 0.

1. (Optional) `repetitionPenalty`: The parameter for repetition penalty, as a float. 1.0 means no penalty. Defaults to 1.0.
1. (Optional) `lengthPenalty`: Exponential penalty to the length, as a float. 1.0 means no penalty. Set to values < 1.0 in order to encourage the model to generate shorter sequences, or to a value > 1.0 in order to encourage the model to produce longer sequences. Defaults to 1.0.
1. (Optional) `badWords`: List of tokens that are not allowed to be generated, as a list of strings. Defaults to null.

@@ -268,0 +263,0 @@ 1. (Optional) `removeEndSequence`: Optional. Whether you want to remove the `endSequence` string from the result. Defaults to false.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc