Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
lshmouse committed Oct 9, 2024
1 parent a87b020 commit 8db8558
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bazel/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Werkzeug==2.2.2
Flask==2.0.2
kubernetes==27.2.0
depyf
vllm
ray
fastapi
# vllm
# ray
# fastapi
5 changes: 5 additions & 0 deletions experimental/python_example/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ py_binary(
srcs = ["python_cli.py"],
)

py_binary(
name = "python_class_call",
srcs = ["python_class_call.py"],
)

py_library(
name = "python_web_lib",
srcs = ["python_web.py"],
Expand Down
15 changes: 15 additions & 0 deletions experimental/python_example/python_class_call.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
''''
This is a simple example of a Python class with a __call__ method.
See: https://github.com/pytorch/pytorch/blob/main/torch/nn/modules/module.py
'''

class Model:
def __init__(self, name):
self.name = name

def __call__(self, x):
return "__call__ " + self.name + " " + str(x)

model = Model("demo")
print(model(10))

0 comments on commit 8db8558

Please sign in to comment.