Class: Google::Apis::AiplatformV1::GoogleCloudAiplatformV1SpeculativeDecodingSpec

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/aiplatform_v1/classes.rb,
lib/google/apis/aiplatform_v1/representations.rb,
lib/google/apis/aiplatform_v1/representations.rb

Overview

Configuration for Speculative Decoding.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1SpeculativeDecodingSpec

Returns a new instance of GoogleCloudAiplatformV1SpeculativeDecodingSpec.



34938
34939
34940
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 34938

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#draft_model_speculationGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1SpeculativeDecodingSpecDraftModelSpeculation

Draft model speculation works by using the smaller model to generate candidate tokens for speculative decoding. Corresponds to the JSON property draftModelSpeculation



34925
34926
34927
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 34925

def draft_model_speculation
  @draft_model_speculation
end

#ngram_speculationGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1SpeculativeDecodingSpecNgramSpeculation

N-Gram speculation works by trying to find matching tokens in the previous prompt sequence and use those as speculation for generating new tokens. Corresponds to the JSON property ngramSpeculation



34931
34932
34933
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 34931

def ngram_speculation
  @ngram_speculation
end

#speculative_token_countFixnum

The number of speculative tokens to generate at each step. Corresponds to the JSON property speculativeTokenCount

Returns:

  • (Fixnum)


34936
34937
34938
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 34936

def speculative_token_count
  @speculative_token_count
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



34943
34944
34945
34946
34947
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 34943

def update!(**args)
  @draft_model_speculation = args[:draft_model_speculation] if args.key?(:draft_model_speculation)
  @ngram_speculation = args[:ngram_speculation] if args.key?(:ngram_speculation)
  @speculative_token_count = args[:speculative_token_count] if args.key?(:speculative_token_count)
end