Skip to main content

No project description provided

Project description

FlagEval Serving

Serving Framework of AI Models for Evaluating on FlagEval Platform.

Installation

pip install --upgrade flageval-serving

Usage

  1. Model: of course we have a model that is ready be evaluated, let's assume it lives in the path: /path/to/model;

  2. Then we can write our service code, let's put the service code in service.py or './tests/service.py' and take a NLP model as the example:

    from flageval.serving.service import NLPModelService, NLPEvalRequest, NLPEvalResponse, NLPCompletion
    
    
    class DemoService(NLPModelService):
        def global_init(self, model_path: str):
            print("Initial model with path", model_path)
    
        def infer(self, req: NLPEvalRequest) -> NLPEvalResponse:
            return NLPEvalResponse(
                completions=[
                    NLPCompletion(
                        text='Hello, world!',
                        tokens='Hello, world!',
                    ),
                ]
            )
    
  3. Finally, we use the flageval-serving command to serve:

    flageval-serving --service service:DemoService dev /path/to/model  # start a development server
    flageval-serving --service service:DemoService run /path/to/model  # start a production server
    

Dockerfile

FlagEval evaluation platform construction image

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flageval_serving-0.2.2.tar.gz (12.1 kB view details)

Uploaded Source

File details

Details for the file flageval_serving-0.2.2.tar.gz.

File metadata

  • Download URL: flageval_serving-0.2.2.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for flageval_serving-0.2.2.tar.gz
Algorithm Hash digest
SHA256 95f87a4eff926a0d1b6fac06e2b41fbb76f4eed66f9f1cada2797f39b88573d2
MD5 6f6603d03bd39618403e5497c548234d
BLAKE2b-256 b50270f2480adb4297d5a68fe9154ee91169567e2082a6f05781775ee0aa7f29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page