-
-
Notifications
You must be signed in to change notification settings - Fork 469
/
Copy pathproject.yml
42 lines (37 loc) · 1.74 KB
/
project.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
title: "FastAPI integration"
description: "Use [FastAPI](https://fastapi.tiangolo.com/) to serve your spaCy models and host modern REST APIs. To start the server, you can run `spacy project run start`. To explore the REST API interactively, navigate to `http://${vars.host}:${vars.port}/docs` in your browser. See the examples for how to query the API using Python or JavaScript."
# Variables can be referenced across the project.yml using ${vars.var_name}
vars:
host: "127.0.0.1"
port: 5000
# These are the directories that the project needs. The project CLI will make
# sure that they always exist.
directories: ["scripts", "assets", "examples"]
# Assets that should be downloaded or available in the directory. You can replace
# this with your own input data.
assets:
- dest: "assets/data.jsonl"
url: "https://raw.githubusercontent.com/explosion/prodigy-recipes/master/example-datasets/plot_summaries.jsonl"
description: "Selected sentences from the CMU Movie Summary Corpus used for testing"
workflows:
start:
- download
- serve
# Project commands, specified in a style similar to CI config files (e.g. Azure
# pipelines). The name is the command name that lets you trigger the command
# via "spacy project run [command] [path]". The help message is optional and
# shown when executing "spacy project run [optional command] [path] --help".
commands:
- name: "download"
help: "Download models"
script:
- "./scripts/download_models.sh"
deps:
- "scripts/download_models.sh"
- name: "serve"
help: "Serve the models via a FastAPI REST API using the given host and port"
script:
- "uvicorn scripts.main:app --reload --host ${vars.host} --port ${vars.port}"
deps:
- "scripts/main.py"
no_skip: true