liujch1998 commited on
Commit
481afa0
β€’
1 Parent(s): 7916def

Max Length

Browse files
Files changed (2) hide show
  1. README.md +2 -2
  2. app.py +1 -1
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
- title: Cd Pi
3
- emoji: 😻
4
  colorFrom: green
5
  colorTo: blue
6
  sdk: gradio
 
1
  ---
2
+ title: Vera
3
+ emoji: πŸ”οΈ
4
  colorFrom: green
5
  colorTo: blue
6
  sdk: gradio
app.py CHANGED
@@ -57,7 +57,7 @@ class Interactive:
57
  'score': 0.5,
58
  'score_calibrated': 0.5,
59
  }
60
- input_ids = self.tokenizer.batch_encode_plus([statement], return_tensors='pt', padding='longest').input_ids.to(device)
61
  with torch.no_grad():
62
  output = self.model(input_ids)
63
  last_hidden_state = output.last_hidden_state.to(device) # (B=1, L, D)
 
57
  'score': 0.5,
58
  'score_calibrated': 0.5,
59
  }
60
+ input_ids = self.tokenizer.batch_encode_plus([statement], return_tensors='pt', padding='longest', truncation='longest_first', max_length=128).input_ids.to(device)
61
  with torch.no_grad():
62
  output = self.model(input_ids)
63
  last_hidden_state = output.last_hidden_state.to(device) # (B=1, L, D)