Spaces:
Sleeping
Sleeping
Update StreamlitModel.py
Browse files- StreamlitModel.py +3 -1
StreamlitModel.py
CHANGED
@@ -19,7 +19,9 @@ import torch.hub
|
|
19 |
|
20 |
profanity.load_censor_words()
|
21 |
|
22 |
-
|
|
|
|
|
23 |
|
24 |
class GPT2_Model(GPT2PreTrainedModel):
|
25 |
|
|
|
19 |
|
20 |
profanity.load_censor_words()
|
21 |
|
22 |
+
#It seems the streamlit space does not allow mps
|
23 |
+
#device = 'cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_built() else 'cpu'
|
24 |
+
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
25 |
|
26 |
class GPT2_Model(GPT2PreTrainedModel):
|
27 |
|