Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] [serve] removed line numbers and fixed file name summary_model.py #34617

Merged
merged 2 commits into from
Apr 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions doc/source/serve/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ First, let's take a look at our text-translation model. Here's its code:
:start-after: __start_translation_model__
:end-before: __end_translation_model__
:language: python
:linenos: true
```

The Python file, called `model.py`, uses the `Translator` class to translate English text to French.
Expand Down Expand Up @@ -133,7 +132,6 @@ Here's the full Ray Serve script that we built:
:start-after: __deployment_full_start__
:end-before: __deployment_full_end__
:language: python
:linenos: true
```

We can run our script with the `serve run` CLI command. This command takes in an import path
Expand Down Expand Up @@ -201,7 +199,7 @@ For example, let's deploy a machine learning pipeline with two steps:
You can copy-paste this script and run it locally. It summarizes the snippet from _A Tale of Two Cities_ to `it was the best of times, it was worst of times .`

```console
$ python model.py
$ python summary_model.py

it was the best of times, it was worst of times .
```
Expand All @@ -212,7 +210,6 @@ Here's a Ray Serve deployment graph that chains the two models together. The gra
:start-after: __start_graph__
:end-before: __end_graph__
:language: python
:linenos: true
```

This script contains our `Summarizer` class converted to a deployment and our `Translator` class with some modifications. In this script, the `Summarizer` class contains the `__call__` method since requests are sent to it first. It also takes in the `Translator` as one of its constructor arguments, so it can forward summarized texts to the `Translator` deployment. The `__call__` method also contains some new code on lines 44 and 45:
Expand Down