textgeneration

package
v0.0.0-...-0d1764f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FinishReason_name = map[int32]string{
		0: "FINISH_REASON_LENGTH",
		1: "FINISH_REASON_EOS_TOKEN",
		2: "FINISH_REASON_STOP_SEQUENCE",
	}
	FinishReason_value = map[string]int32{
		"FINISH_REASON_LENGTH":        0,
		"FINISH_REASON_EOS_TOKEN":     1,
		"FINISH_REASON_STOP_SEQUENCE": 2,
	}
)

Enum value maps for FinishReason.

View Source
var File_textgeneration_proto protoreflect.FileDescriptor
View Source
var Greeter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Greeter",
	HandlerType: (*GreeterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SayHello",
			Handler:    _Greeter_SayHello_Handler,
		},
		{
			MethodName: "Decode",
			Handler:    _Greeter_Decode_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "textgeneration.proto",
}

Greeter_ServiceDesc is the grpc.ServiceDesc for Greeter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterGreeterServer

func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer)

Types

type CachedBatch

type CachedBatch struct {

	/// Batch ID
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	/// Individual requests ids
	RequestIds []uint64 `protobuf:"varint,2,rep,packed,name=request_ids,json=requestIds,proto3" json:"request_ids,omitempty"`
	/// Batch size (==len(requests))
	Size uint32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
	/// Maximum number of tokens this batch will grow to
	MaxTokens uint32 `protobuf:"varint,4,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"`
	// contains filtered or unexported fields
}

func (*CachedBatch) Descriptor deprecated

func (*CachedBatch) Descriptor() ([]byte, []int)

Deprecated: Use CachedBatch.ProtoReflect.Descriptor instead.

func (*CachedBatch) GetId

func (x *CachedBatch) GetId() uint64

func (*CachedBatch) GetMaxTokens

func (x *CachedBatch) GetMaxTokens() uint32

func (*CachedBatch) GetRequestIds

func (x *CachedBatch) GetRequestIds() []uint64

func (*CachedBatch) GetSize

func (x *CachedBatch) GetSize() uint32

func (*CachedBatch) ProtoMessage

func (*CachedBatch) ProtoMessage()

func (*CachedBatch) ProtoReflect

func (x *CachedBatch) ProtoReflect() protoreflect.Message

func (*CachedBatch) Reset

func (x *CachedBatch) Reset()

func (*CachedBatch) String

func (x *CachedBatch) String() string

type DecodeRequest

type DecodeRequest struct {

	/// Cached batches
	Batches []*CachedBatch `protobuf:"bytes,1,rep,name=batches,proto3" json:"batches,omitempty"`
	// contains filtered or unexported fields
}

func (*DecodeRequest) Descriptor deprecated

func (*DecodeRequest) Descriptor() ([]byte, []int)

Deprecated: Use DecodeRequest.ProtoReflect.Descriptor instead.

func (*DecodeRequest) GetBatches

func (x *DecodeRequest) GetBatches() []*CachedBatch

func (*DecodeRequest) ProtoMessage

func (*DecodeRequest) ProtoMessage()

func (*DecodeRequest) ProtoReflect

func (x *DecodeRequest) ProtoReflect() protoreflect.Message

func (*DecodeRequest) Reset

func (x *DecodeRequest) Reset()

func (*DecodeRequest) String

func (x *DecodeRequest) String() string

type DecodeResponse

type DecodeResponse struct {

	/// Decodes
	Generations []*Generation `protobuf:"bytes,1,rep,name=generations,proto3" json:"generations,omitempty"`
	/// Next batch (cached)
	Batch *CachedBatch `protobuf:"bytes,2,opt,name=batch,proto3,oneof" json:"batch,omitempty"`
	// contains filtered or unexported fields
}

func (*DecodeResponse) Descriptor deprecated

func (*DecodeResponse) Descriptor() ([]byte, []int)

Deprecated: Use DecodeResponse.ProtoReflect.Descriptor instead.

func (*DecodeResponse) GetBatch

func (x *DecodeResponse) GetBatch() *CachedBatch

func (*DecodeResponse) GetGenerations

func (x *DecodeResponse) GetGenerations() []*Generation

func (*DecodeResponse) ProtoMessage

func (*DecodeResponse) ProtoMessage()

func (*DecodeResponse) ProtoReflect

func (x *DecodeResponse) ProtoReflect() protoreflect.Message

func (*DecodeResponse) Reset

func (x *DecodeResponse) Reset()

func (*DecodeResponse) String

func (x *DecodeResponse) String() string

type FinishReason

type FinishReason int32
const (
	FinishReason_FINISH_REASON_LENGTH        FinishReason = 0
	FinishReason_FINISH_REASON_EOS_TOKEN     FinishReason = 1
	FinishReason_FINISH_REASON_STOP_SEQUENCE FinishReason = 2
)

func (FinishReason) Descriptor

func (FinishReason) Enum

func (x FinishReason) Enum() *FinishReason

func (FinishReason) EnumDescriptor deprecated

func (FinishReason) EnumDescriptor() ([]byte, []int)

Deprecated: Use FinishReason.Descriptor instead.

func (FinishReason) Number

func (FinishReason) String

func (x FinishReason) String() string

func (FinishReason) Type

type GeneratedText

type GeneratedText struct {

	/// Output
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	/// Number of generated tokens
	GeneratedTokens uint32 `protobuf:"varint,2,opt,name=generated_tokens,json=generatedTokens,proto3" json:"generated_tokens,omitempty"`
	/// Finish reason
	FinishReason FinishReason `protobuf:"varint,3,opt,name=finish_reason,json=finishReason,proto3,enum=FinishReason" json:"finish_reason,omitempty"`
	/// Seed
	Seed *uint64 `protobuf:"varint,4,opt,name=seed,proto3,oneof" json:"seed,omitempty"`
	// contains filtered or unexported fields
}

func (*GeneratedText) Descriptor deprecated

func (*GeneratedText) Descriptor() ([]byte, []int)

Deprecated: Use GeneratedText.ProtoReflect.Descriptor instead.

func (*GeneratedText) GetFinishReason

func (x *GeneratedText) GetFinishReason() FinishReason

func (*GeneratedText) GetGeneratedTokens

func (x *GeneratedText) GetGeneratedTokens() uint32

func (*GeneratedText) GetSeed

func (x *GeneratedText) GetSeed() uint64

func (*GeneratedText) GetText

func (x *GeneratedText) GetText() string

func (*GeneratedText) ProtoMessage

func (*GeneratedText) ProtoMessage()

func (*GeneratedText) ProtoReflect

func (x *GeneratedText) ProtoReflect() protoreflect.Message

func (*GeneratedText) Reset

func (x *GeneratedText) Reset()

func (*GeneratedText) String

func (x *GeneratedText) String() string

type Generation

type Generation struct {

	/// Request ID
	RequestId uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	/// Prefill tokens (optional)
	PrefillTokens *PrefillTokens `protobuf:"bytes,2,opt,name=prefill_tokens,json=prefillTokens,proto3" json:"prefill_tokens,omitempty"`
	/// Token ID
	TokenId uint32 `protobuf:"varint,3,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"`
	/// Logprob
	TokenLogprob float32 `protobuf:"fixed32,4,opt,name=token_logprob,json=tokenLogprob,proto3" json:"token_logprob,omitempty"`
	/// Text
	TokenText string `protobuf:"bytes,5,opt,name=token_text,json=tokenText,proto3" json:"token_text,omitempty"`
	/// Is it a special token
	TokenIsSpecial bool `protobuf:"varint,6,opt,name=token_is_special,json=tokenIsSpecial,proto3" json:"token_is_special,omitempty"`
	/// Complete generated text
	GeneratedText *GeneratedText `protobuf:"bytes,7,opt,name=generated_text,json=generatedText,proto3,oneof" json:"generated_text,omitempty"`
	// contains filtered or unexported fields
}

func (*Generation) Descriptor deprecated

func (*Generation) Descriptor() ([]byte, []int)

Deprecated: Use Generation.ProtoReflect.Descriptor instead.

func (*Generation) GetGeneratedText

func (x *Generation) GetGeneratedText() *GeneratedText

func (*Generation) GetPrefillTokens

func (x *Generation) GetPrefillTokens() *PrefillTokens

func (*Generation) GetRequestId

func (x *Generation) GetRequestId() uint64

func (*Generation) GetTokenId

func (x *Generation) GetTokenId() uint32

func (*Generation) GetTokenIsSpecial

func (x *Generation) GetTokenIsSpecial() bool

func (*Generation) GetTokenLogprob

func (x *Generation) GetTokenLogprob() float32

func (*Generation) GetTokenText

func (x *Generation) GetTokenText() string

func (*Generation) ProtoMessage

func (*Generation) ProtoMessage()

func (*Generation) ProtoReflect

func (x *Generation) ProtoReflect() protoreflect.Message

func (*Generation) Reset

func (x *Generation) Reset()

func (*Generation) String

func (x *Generation) String() string

type GreeterClient

type GreeterClient interface {
	// Sends a greeting
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
	/// Decode token for a list of prefilled batches
	Decode(ctx context.Context, in *DecodeRequest, opts ...grpc.CallOption) (*DecodeResponse, error)
}

GreeterClient is the client API for Greeter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewGreeterClient

func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient

type GreeterServer

type GreeterServer interface {
	// Sends a greeting
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
	/// Decode token for a list of prefilled batches
	Decode(context.Context, *DecodeRequest) (*DecodeResponse, error)
	// contains filtered or unexported methods
}

GreeterServer is the server API for Greeter service. All implementations must embed UnimplementedGreeterServer for forward compatibility

type HelloReply

type HelloReply struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

The response message containing the greetings

func (*HelloReply) Descriptor deprecated

func (*HelloReply) Descriptor() ([]byte, []int)

Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.

func (*HelloReply) GetMessage

func (x *HelloReply) GetMessage() string

func (*HelloReply) ProtoMessage

func (*HelloReply) ProtoMessage()

func (*HelloReply) ProtoReflect

func (x *HelloReply) ProtoReflect() protoreflect.Message

func (*HelloReply) Reset

func (x *HelloReply) Reset()

func (*HelloReply) String

func (x *HelloReply) String() string

type HelloRequest

type HelloRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

The request message containing the user's name.

func (*HelloRequest) Descriptor deprecated

func (*HelloRequest) Descriptor() ([]byte, []int)

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetName

func (x *HelloRequest) GetName() string

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect

func (x *HelloRequest) ProtoReflect() protoreflect.Message

func (*HelloRequest) Reset

func (x *HelloRequest) Reset()

func (*HelloRequest) String

func (x *HelloRequest) String() string

type PrefillTokens

type PrefillTokens struct {

	/// Prefill Token IDs
	Ids []uint32 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"`
	/// Prefill Logprobs
	Logprobs []float32 `protobuf:"fixed32,2,rep,packed,name=logprobs,proto3" json:"logprobs,omitempty"`
	/// Prefill tokens
	Texts []string `protobuf:"bytes,3,rep,name=texts,proto3" json:"texts,omitempty"`
	// contains filtered or unexported fields
}

func (*PrefillTokens) Descriptor deprecated

func (*PrefillTokens) Descriptor() ([]byte, []int)

Deprecated: Use PrefillTokens.ProtoReflect.Descriptor instead.

func (*PrefillTokens) GetIds

func (x *PrefillTokens) GetIds() []uint32

func (*PrefillTokens) GetLogprobs

func (x *PrefillTokens) GetLogprobs() []float32

func (*PrefillTokens) GetTexts

func (x *PrefillTokens) GetTexts() []string

func (*PrefillTokens) ProtoMessage

func (*PrefillTokens) ProtoMessage()

func (*PrefillTokens) ProtoReflect

func (x *PrefillTokens) ProtoReflect() protoreflect.Message

func (*PrefillTokens) Reset

func (x *PrefillTokens) Reset()

func (*PrefillTokens) String

func (x *PrefillTokens) String() string

type UnimplementedGreeterServer

type UnimplementedGreeterServer struct {
}

UnimplementedGreeterServer must be embedded to have forward compatible implementations.

func (UnimplementedGreeterServer) Decode

func (UnimplementedGreeterServer) SayHello

type UnsafeGreeterServer

type UnsafeGreeterServer interface {
	// contains filtered or unexported methods
}

UnsafeGreeterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreeterServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL