File tree Expand file tree Collapse file tree 2 files changed +20
-12
lines changed
src/lightning_app/components/serve Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,19 @@ ___________________
32
32
:nosignatures:
33
33
:template: classtemplate_no_index.rst
34
34
35
+ ~database.client.DatabaseClient
36
+ ~database.server.Database
35
37
~python.popen.PopenPythonScript
36
38
~python.tracer.TracerPythonScript
37
39
~training.LightningTrainerScript
38
40
~serve.gradio.ServeGradio
39
41
~serve.serve.ModelInferenceAPI
42
+ ~serve.python_server.PythonServer
43
+ ~serve.streamlit.ServeStreamlit
44
+ ~multi_node.base.MultiNode
45
+ ~multi_node.lite.LiteMultiNode
46
+ ~multi_node.pytorch_spawn.PyTorchSpawnMultiNode
47
+ ~multi_node.trainer.LightningTrainerMultiNode
40
48
~auto_scaler.AutoScaler
41
49
42
50
----
Original file line number Diff line number Diff line change @@ -114,26 +114,26 @@ def __init__( # type: ignore
114
114
The default data type is good enough for the basic usecases and it expects the data
115
115
to be a json object that has one key called `payload`
116
116
117
- ```
118
- input_data = {"payload": "some data"}
119
- ```
117
+ .. code-block:: python
118
+
119
+ input_data = {"payload": "some data"}
120
120
121
121
and this can be accessed as `request.payload` in the `predict` method.
122
122
123
- ```
124
- def predict(self, request):
125
- data = request.payload
126
- ```
123
+ .. code-block:: python
124
+
125
+ def predict(self, request):
126
+ data = request.payload
127
127
128
128
output_type: Optional `output_type` to be provided. This needs to be a pydantic BaseModel class.
129
129
The default data type is good enough for the basic usecases. It expects the return value of
130
130
the `predict` method to be a dictionary with one key called `prediction`.
131
131
132
- ```
133
- def predict(self, request):
134
- # some code
135
- return {"prediction": " some data"}
136
- ```
132
+ .. code-block:: python
133
+
134
+ def predict(self, request):
135
+ # some code
136
+ return {"prediction": "some data"}
137
137
138
138
and this can be accessed as `response.json()["prediction"]` in the client if
139
139
you are using requests library
You can’t perform that action at this time.
0 commit comments