From 26586c615292cce0ac4c19cdacea6b54fe8b2b50 Mon Sep 17 00:00:00 2001 From: Gtax2006 Date: Thu, 28 May 2026 01:01:37 +0800 Subject: [PATCH] docs: add error handling section for ML inference (#228) --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 551b552..d91de3f 100644 --- a/README.md +++ b/README.md @@ -378,3 +378,16 @@ Browse and discover AI models on the [OpenGradient Model Hub](https://hub.opengr - Visit our [documentation](https://docs.opengradient.ai/) for detailed guides - Join our [community](https://discord.gg/axammqTRDz) for support and discussions + + +## Error Handling + +When using ML inference functions, always wrap calls in try/except: + +```python +try: + result = client.inference.predict(model, input_data) + print(result) +except Exception as e: + print(f"Inference failed: {e}") +```