Spaces:
Paused
Paused
Tonic commited on
Commit ·
762264d
1
Parent(s): cdc40a2
adds Zero GPU longer timeout
Browse files
app.py
CHANGED
|
@@ -51,7 +51,7 @@ def clear_gpu_memory():
|
|
| 51 |
torch.cuda.empty_cache()
|
| 52 |
gc.collect()
|
| 53 |
|
| 54 |
-
@spaces.GPU
|
| 55 |
def load_pipeline():
|
| 56 |
"""Load the Chronos model with GPU configuration"""
|
| 57 |
global pipeline
|
|
@@ -279,7 +279,7 @@ def calculate_bollinger_bands(prices: pd.Series, period: int = 20, std_dev: int
|
|
| 279 |
lower_band = middle_band - (std * std_dev)
|
| 280 |
return upper_band, middle_band, lower_band
|
| 281 |
|
| 282 |
-
@spaces.GPU
|
| 283 |
def make_prediction(symbol: str, timeframe: str = "1d", prediction_days: int = 5, strategy: str = "chronos") -> Tuple[Dict, go.Figure]:
|
| 284 |
"""
|
| 285 |
Make prediction using selected strategy.
|
|
@@ -866,4 +866,4 @@ def create_interface():
|
|
| 866 |
|
| 867 |
if __name__ == "__main__":
|
| 868 |
demo = create_interface()
|
| 869 |
-
demo.launch(
|
|
|
|
| 51 |
torch.cuda.empty_cache()
|
| 52 |
gc.collect()
|
| 53 |
|
| 54 |
+
@spaces.GPU(duration=180)
|
| 55 |
def load_pipeline():
|
| 56 |
"""Load the Chronos model with GPU configuration"""
|
| 57 |
global pipeline
|
|
|
|
| 279 |
lower_band = middle_band - (std * std_dev)
|
| 280 |
return upper_band, middle_band, lower_band
|
| 281 |
|
| 282 |
+
@spaces.GPU(duration=180)
|
| 283 |
def make_prediction(symbol: str, timeframe: str = "1d", prediction_days: int = 5, strategy: str = "chronos") -> Tuple[Dict, go.Figure]:
|
| 284 |
"""
|
| 285 |
Make prediction using selected strategy.
|
|
|
|
| 866 |
|
| 867 |
if __name__ == "__main__":
|
| 868 |
demo = create_interface()
|
| 869 |
+
demo.launch(ssr_mode=False, mcp_server=True)
|