Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -61,10 +61,12 @@ rouge = load_metric('rouge')
|
|
61 |
meteor = load_metric('meteor')
|
62 |
bertscore = load_metric('bertscore')
|
63 |
|
|
|
|
|
|
|
64 |
MAX_INPUT_LENGTH = 256
|
65 |
MAX_TARGET_LENGTH = 128
|
66 |
|
67 |
-
|
68 |
def preprocess_function(examples, **kwargs):
|
69 |
"""
|
70 |
Preprocess entries of the given dataset
|
|
|
61 |
meteor = load_metric('meteor')
|
62 |
bertscore = load_metric('bertscore')
|
63 |
|
64 |
+
# use gpu if it's available
|
65 |
+
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
66 |
+
|
67 |
MAX_INPUT_LENGTH = 256
|
68 |
MAX_TARGET_LENGTH = 128
|
69 |
|
|
|
70 |
def preprocess_function(examples, **kwargs):
|
71 |
"""
|
72 |
Preprocess entries of the given dataset
|