Spaces:
Running
Running
Update app.py
Browse filesChanged "pyTorchTensor" to pt
app.py
CHANGED
@@ -76,7 +76,9 @@ def summarize(file, text, style, length):
|
|
76 |
# Note: 1024 tokens typically correspond to about 750–800 English words,
|
77 |
# depending on the tokenizer and language. ---------------------------------------------- (!)
|
78 |
# Make sure to display this token/word information to the user in the app UI for clarity.
|
79 |
-
|
|
|
|
|
80 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
81 |
model.to(device)
|
82 |
inputs = inputs.to(device)
|
|
|
76 |
# Note: 1024 tokens typically correspond to about 750–800 English words,
|
77 |
# depending on the tokenizer and language. ---------------------------------------------- (!)
|
78 |
# Make sure to display this token/word information to the user in the app UI for clarity.
|
79 |
+
|
80 |
+
# Note: "pyTorchTensor" is not a valid TensorType, use one of ['pt', 'tf', 'np', 'jax', 'mlx']
|
81 |
+
inputs = tokenizer.encode(prompt, return_tensors="pt", truncation=True, max_length=1024)
|
82 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
83 |
model.to(device)
|
84 |
inputs = inputs.to(device)
|