girish00 commited on
Commit
7e079b1
·
verified ·
1 Parent(s): 0a19b76

clean cloud unavailable error

Browse files
Files changed (1) hide show
  1. infer_cloud.py +20 -1
infer_cloud.py CHANGED
@@ -176,4 +176,23 @@ def main():
176
 
177
 
178
  if __name__ == "__main__":
179
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
 
177
 
178
  if __name__ == "__main__":
179
+ try:
180
+ main()
181
+ except RuntimeError as exc:
182
+ print(
183
+ json.dumps(
184
+ {
185
+ "error": "Hugging Face cloud inference is unavailable for this model repo.",
186
+ "reason": str(exc),
187
+ "cloud_available": False,
188
+ "hint": (
189
+ "Use the default local fallback, deploy a Hugging Face Dedicated "
190
+ "Inference Endpoint, or run the model on a cloud VM."
191
+ ),
192
+ },
193
+ indent=2,
194
+ ensure_ascii=False,
195
+ ),
196
+ file=sys.stderr,
197
+ )
198
+ sys.exit(1)