hideosnes commited on
Commit
cf271ff
·
verified ·
1 Parent(s): 3d68164

Update app.py

Browse files

Changed "pyTorchTensor" to pt

Files changed (1) hide show
  1. app.py +3 -1
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
- inputs = tokenizer.encode(prompt, return_tensors="pyTorchTensor", truncation=True, max_length=1024)
 
 
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)