Skip to content
Merged
Changes from all commits
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: 3 additions & 2 deletions flash/create-endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ from runpod_flash import Endpoint, GpuType
api = Endpoint(
name="inference-api",
gpu=GpuType.NVIDIA_GEFORCE_RTX_4090,
workers=(1, 5)
workers=(1, 5),
dependencies=["torch"]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation: PR #252 fixes flash build to extract dependencies from Endpoint() variable assignment patterns (load-balanced endpoints). Adding this example confirms the pattern is fully supported after the fix.
View source

)

@api.post("/predict")
async def predict(data: dict) -> dict:
import torch
import torch # Import inside the function body
# Run inference
return {"prediction": "result"}

Expand Down
Loading