-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add definitions endpoint, minor refactoring
Signed-off-by: Panos Vagenas <35837085+vagenas@users.noreply.github.com>
- Loading branch information
Showing
6 changed files
with
50 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Model API | ||
|
||
> Currently in **beta**. | ||
The Model API allows users to serve and integrate their own models. | ||
|
||
## Usage | ||
```python | ||
from deepsearch.model.server.deepsearch_annotator_app import DeepSearchAnnotatorApp | ||
|
||
annotator = ... # e.g. SimpleTextGeographyAnnotator() | ||
app = DeepSearchAnnotatorApp() | ||
app.register_annotator(annotator) | ||
app.run() | ||
``` | ||
|
||
For a complete example, check [examples/main.py](examples/main.py). | ||
|
||
## Models | ||
For an example, check | ||
[examples/simple_text_geography_annotator/](examples/simple_text_geography_annotator/). | ||
|
||
## Base models | ||
Check [base/](base/). |
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from deepsearch.model.examples.simple_text_geography_annotator.simple_text_geography_annotator import ( # type: ignore | ||
SimpleTextGeographyAnnotator, | ||
) | ||
from deepsearch.model.server.deepsearch_annotator_app import DeepSearchAnnotatorApp | ||
|
||
|
||
def run(): | ||
app = DeepSearchAnnotatorApp() | ||
app.register_annotator(SimpleTextGeographyAnnotator()) | ||
app.register_annotator(SimpleTextGeographyAnnotator(), name="foo") | ||
app.run() | ||
|
||
|
||
if __name__ == "__main__": | ||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters