Skip to content

Commit adabdfe

Browse files
russellbrasmith
authored andcommitted
[Doc] fix third-party model example (vllm-project#9771)
Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Randall Smith <Randall.Smith@amd.com>
1 parent 60d2cfc commit adabdfe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/source/models/adding_model.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ If you are running api server with :code:`vllm serve <args>`, you can wrap the e
133133
from vllm import ModelRegistry
134134
from your_code import YourModelForCausalLM
135135
ModelRegistry.register_model("YourModelForCausalLM", YourModelForCausalLM)
136-
import runpy
137-
runpy.run_module('vllm.entrypoints.openai.api_server', run_name='__main__')
136+
137+
if __name__ == '__main__':
138+
import runpy
139+
runpy.run_module('vllm.entrypoints.openai.api_server', run_name='__main__')
138140
139141
Save the above code in a file and run it with :code:`python your_file.py <args>`.

0 commit comments

Comments
 (0)