Ana içeriğe geç

Class: HuggingFaceLLM

Extends

  • BaseLLM

Constructors

new HuggingFaceLLM()

new HuggingFaceLLM(init?): HuggingFaceLLM

Parameters

init?: HFLLMConfig

Returns

HuggingFaceLLM

Overrides

BaseLLM.constructor

Source

packages/core/src/llm/huggingface.ts:171

Properties

contextWindow

contextWindow: number

Source

packages/core/src/llm/huggingface.ts:166


maxTokens?

optional maxTokens: number

Source

packages/core/src/llm/huggingface.ts:165


model

private model: null | PreTrainedModel = null

Source

packages/core/src/llm/huggingface.ts:169


modelName

modelName: string

Source

packages/core/src/llm/huggingface.ts:161


temperature

temperature: number

Source

packages/core/src/llm/huggingface.ts:163


tokenizer

private tokenizer: null | PreTrainedTokenizer = null

Source

packages/core/src/llm/huggingface.ts:168


tokenizerName

tokenizerName: string

Source

packages/core/src/llm/huggingface.ts:162


topP

topP: number

Source

packages/core/src/llm/huggingface.ts:164

Accessors

metadata

get metadata(): LLMMetadata

Returns

LLMMetadata

Source

packages/core/src/llm/huggingface.ts:181

Methods

chat()

chat(params)

chat(params): Promise<AsyncIterable <ChatResponseChunk>>

Parameters

params: LLMChatParamsStreaming<object, object>

Returns

Promise<AsyncIterable <ChatResponseChunk>>

Overrides

BaseLLM.chat

Source

packages/core/src/llm/huggingface.ts:208

chat(params)

chat(params): Promise <ChatResponse<object>>

Parameters

params: LLMChatParamsNonStreaming<object, object>

Returns

Promise <ChatResponse<object>>

Overrides

BaseLLM.chat

Source

packages/core/src/llm/huggingface.ts:211


complete()

complete(params)

complete(params): Promise<AsyncIterable <CompletionResponse>>

Parameters

params: LLMCompletionParamsStreaming

Returns

Promise<AsyncIterable <CompletionResponse>>

Inherited from

BaseLLM.complete

Source

packages/core/src/llm/base.ts:22

complete(params)

complete(params): Promise <CompletionResponse>

Parameters

params: LLMCompletionParamsNonStreaming

Returns

Promise <CompletionResponse>

Inherited from

BaseLLM.complete

Source

packages/core/src/llm/base.ts:25


getModel()

getModel(): Promise<PreTrainedModel>

Returns

Promise<PreTrainedModel>

Source

packages/core/src/llm/huggingface.ts:200


getTokenizer()

getTokenizer(): Promise<PreTrainedTokenizer>

Returns

Promise<PreTrainedTokenizer>

Source

packages/core/src/llm/huggingface.ts:192


nonStreamChat()

protected nonStreamChat(params): Promise <ChatResponse<object>>

Parameters

params: LLMChatParamsNonStreaming<object, object>

Returns

Promise <ChatResponse<object>>

Source

packages/core/src/llm/huggingface.ts:220


streamChat()

protected streamChat(params): AsyncIterable <ChatResponseChunk>

Parameters

params: LLMChatParamsStreaming<object, object>

Returns

AsyncIterable <ChatResponseChunk>

Source

packages/core/src/llm/huggingface.ts:252