Skip to content

Latest commit

 

History

History
 
 

model-evaluation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Vespa sample applications - Basic Search

A sample Vespa application to evaluate models in the application package.

Please refer to stateless model evaluation for more information.

Executable example

Check-out, compile and run:

$ git clone https://github.com/vespa-engine/sample-apps.git
$ VESPA_SAMPLE_APPS=`pwd`/sample-apps
$ cd $VESPA_SAMPLE_APPS/model-evaluation && mvn clean package
$ docker run --detach --name vespa --hostname vespa-container --privileged \
  --volume $VESPA_SAMPLE_APPS:/vespa-sample-apps --publish 8080:8080 vespaengine/vespa

Wait for the configserver to start:

$ docker exec vespa bash -c 'curl -s --head http://localhost:19071/ApplicationStatus'

Deploy the application:

$ docker exec vespa bash -c '/opt/vespa/bin/vespa-deploy prepare /vespa-sample-apps/model-evaluation/target/application.zip && \
  /opt/vespa/bin/vespa-deploy activate'

Wait for the application to start:

$ curl -s --head http://localhost:8080/ApplicationStatus

Test the application - REST API

$ curl -s 'http://localhost:8080/model-evaluation/v1/' | python -m json.tool
$ curl -s 'http://localhost:8080/model-evaluation/v1/mnist_softmax/eval?Placeholder=%7B%7Bd0%3A0%2Cd1%3A0%7D%3A0.1%7D' | python -m json.tool

Test the application - Java API

$ curl -s 'http://localhost:8080/models/?model=mnist_softmax&function=default.add&argumentName=Placeholder&argumentValue=%7B%7Bd0%3A0%2Cd1%3A0%7D%3A0.1%7D' | python -m json.tool

Shutdown and remove the container:

$ docker rm -f vespa