Documentation ¶
Index ¶
- Constants
- type Config
- type RequestHandler
- func NewServerForLanguageModeling(predictor languagemodeling.Interface) RequestHandler
- func NewServerForQuestionAnswering(engine questionanswering.Interface) RequestHandler
- func NewServerForTextClassification(classifier textclassification.Interface) RequestHandler
- func NewServerForTextEncoding(encoder textencoding.Interface) RequestHandler
- func NewServerForTextGeneration(generator textgeneration.Interface) RequestHandler
- func NewServerForTokenClassification(classifier tokenclassification.Interface) RequestHandler
- func NewServerForZeroShotClassification(classifier zeroshotclassifier.Interface) RequestHandler
- func ResolveRequestHandler(model any) (RequestHandler, error)
- type Server
Constants ¶
View Source
const ( // DefaultNetwork is the default network. DefaultNetwork = "tcp4" // DefaultAddress is the default address. DefaultAddress = ":8080" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Network string Address string AllowedOrigins []string TLSEnabled bool TLSCert string TLSKey string }
Config is the configuration for the server.
type RequestHandler ¶
type RequestHandler interface { RegisterServer(grpc.ServiceRegistrar) error RegisterHandlerServer(context.Context, *runtime.ServeMux) error }
RequestHandler is implemented by any task-specific service that can be registered in the main Server.
func NewServerForLanguageModeling ¶
func NewServerForLanguageModeling(predictor languagemodeling.Interface) RequestHandler
func NewServerForQuestionAnswering ¶
func NewServerForQuestionAnswering(engine questionanswering.Interface) RequestHandler
func NewServerForTextClassification ¶
func NewServerForTextClassification(classifier textclassification.Interface) RequestHandler
func NewServerForTextEncoding ¶
func NewServerForTextEncoding(encoder textencoding.Interface) RequestHandler
func NewServerForTextGeneration ¶
func NewServerForTextGeneration(generator textgeneration.Interface) RequestHandler
func NewServerForTokenClassification ¶
func NewServerForTokenClassification(classifier tokenclassification.Interface) RequestHandler
func NewServerForZeroShotClassification ¶
func NewServerForZeroShotClassification(classifier zeroshotclassifier.Interface) RequestHandler
func ResolveRequestHandler ¶
func ResolveRequestHandler(model any) (RequestHandler, error)
ResolveRequestHandler instantiates a new task-server based on the model.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a server that provides gRPC and HTTP/2 APIs.
func (*Server) ClientAddr ¶
ClientAddr returns the Address used to connect clients (without the network). Helpful in testing when we designate a random port (0).
func (*Server) ReadyForConnections ¶
ReadyForConnections returns `true` if the server is ready to accept requests. If after the duration `dur` the server is still not ready, returns `false`.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
gen
|
|
proto/go/languagemodeling/v1
Package languagemodelingv1 is a reverse proxy.
|
Package languagemodelingv1 is a reverse proxy. |
proto/go/questionanswering/v1
Package questionansweringv1 is a reverse proxy.
|
Package questionansweringv1 is a reverse proxy. |
proto/go/textclassification/v1
Package textclassificationv1 is a reverse proxy.
|
Package textclassificationv1 is a reverse proxy. |
proto/go/textencoding/v1
Package textencodingv1 is a reverse proxy.
|
Package textencodingv1 is a reverse proxy. |
proto/go/textgeneration/v1
Package textgenerationv1 is a reverse proxy.
|
Package textgenerationv1 is a reverse proxy. |
proto/go/tokenclassification/v1
Package tokenclassificationv1 is a reverse proxy.
|
Package tokenclassificationv1 is a reverse proxy. |
proto/go/zeroshot/v1
Package zeroshotv1 is a reverse proxy.
|
Package zeroshotv1 is a reverse proxy. |
Click to show internal directories.
Click to hide internal directories.