Spaces:
Build error
Build error
Commit
·
97c3c4d
1
Parent(s):
f4fc59a
Update app.py
Browse files
app.py
CHANGED
@@ -27,15 +27,19 @@ def summarize(inputs,model,summary_length):
|
|
27 |
device = "cpu"
|
28 |
#"cuda" if torch.cuda.is_available() else "CPU"
|
29 |
model.to(device)
|
30 |
-
|
|
|
|
|
|
|
|
|
31 |
#define model inputs
|
32 |
inputs = tokenizer(
|
33 |
-
|
34 |
max_length=512,
|
35 |
truncation=True,
|
36 |
padding="max_length",
|
37 |
-
|
38 |
return_tensors='pt').to(device)
|
|
|
39 |
#generate preds
|
40 |
preds = model.generate(**inputs,max_length=summary_length+25,min_length=summary_length-25)
|
41 |
#we decode the predictions to store them
|
|
|
27 |
device = "cpu"
|
28 |
#"cuda" if torch.cuda.is_available() else "CPU"
|
29 |
model.to(device)
|
30 |
+
|
31 |
+
|
32 |
+
print(str(inputs))
|
33 |
+
print(str(prefix)+str(inputs))
|
34 |
+
|
35 |
#define model inputs
|
36 |
inputs = tokenizer(
|
37 |
+
inputs,
|
38 |
max_length=512,
|
39 |
truncation=True,
|
40 |
padding="max_length",
|
|
|
41 |
return_tensors='pt').to(device)
|
42 |
+
|
43 |
#generate preds
|
44 |
preds = model.generate(**inputs,max_length=summary_length+25,min_length=summary_length-25)
|
45 |
#we decode the predictions to store them
|