Spaces:
Paused
Paused
Tonic commited on
Commit ·
70c86c3
1
Parent(s): a96f134
add decorator to load_pipeline for ZerGPU
Browse files
app.py
CHANGED
|
@@ -377,6 +377,13 @@ def make_prediction(symbol: str, timeframe: str = "1d", prediction_days: int = 5
|
|
| 377 |
with torch.amp.autocast('cuda'):
|
| 378 |
# Ensure all inputs are on GPU
|
| 379 |
context = context.to(device)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 380 |
quantiles, mean = pipe.predict_quantiles(
|
| 381 |
context=context,
|
| 382 |
prediction_length=actual_prediction_length,
|
|
|
|
| 377 |
with torch.amp.autocast('cuda'):
|
| 378 |
# Ensure all inputs are on GPU
|
| 379 |
context = context.to(device)
|
| 380 |
+
|
| 381 |
+
# Move quantile levels to GPU
|
| 382 |
+
quantile_levels = torch.tensor([0.1, 0.5, 0.9], device=device, dtype=dtype)
|
| 383 |
+
|
| 384 |
+
# Ensure prediction length is on GPU
|
| 385 |
+
prediction_length = torch.tensor(actual_prediction_length, device=device, dtype=torch.long)
|
| 386 |
+
|
| 387 |
quantiles, mean = pipe.predict_quantiles(
|
| 388 |
context=context,
|
| 389 |
prediction_length=actual_prediction_length,
|