Spaces:
Runtime error
Runtime error
remove zerogpu
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from typing import Optional, Iterable
|
|
3 |
|
4 |
# Third-party library imports
|
5 |
from transformers import PretrainedConfig, AutoformerForPrediction
|
6 |
-
from functools import
|
7 |
|
8 |
import gradio as gr
|
9 |
import spaces
|
@@ -245,15 +245,8 @@ def plot(ts_index, test_dataset, forecasts, prediction_length):
|
|
245 |
plt.legend()
|
246 |
return fig
|
247 |
|
248 |
-
|
249 |
-
|
250 |
-
zero = torch.Tensor([0]).cuda()
|
251 |
-
print(zero.device) # <-- 'cpu' 🤔
|
252 |
-
|
253 |
-
@spaces.GPU
|
254 |
def do_prediction(days_to_predict: int):
|
255 |
-
device =
|
256 |
-
|
257 |
# Define the desired prediction length
|
258 |
prediction_length = 7 # Number of time steps to predict into the future
|
259 |
freq = "1D" # Daily frequency
|
|
|
3 |
|
4 |
# Third-party library imports
|
5 |
from transformers import PretrainedConfig, AutoformerForPrediction
|
6 |
+
from functools import partial
|
7 |
|
8 |
import gradio as gr
|
9 |
import spaces
|
|
|
245 |
plt.legend()
|
246 |
return fig
|
247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
def do_prediction(days_to_predict: int):
|
249 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
250 |
# Define the desired prediction length
|
251 |
prediction_length = 7 # Number of time steps to predict into the future
|
252 |
freq = "1D" # Daily frequency
|