clr commited on
Commit
d3aa036
·
1 Parent(s): a16e474

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -41,15 +41,16 @@ def recc(a_f):
41
  input_values = torch.tensor(input_values, device=device).unsqueeze(0)
42
  logits = model(input_values).logits
43
  pred_ids = torch.argmax(logits, dim=-1)
44
- pred_ids= pred_ids[0].cpu().detach()
45
  return pred_ids
46
  #xcp = processor.decode(pred_ids)
47
  #return xcp
48
 
49
  def dec(pids):
50
  with torch.inference_mode():
51
- xcp = processor.decode(pids)
52
  return xcp
 
53
 
54
  bl = gr.Blocks()
55
  with bl:
 
41
  input_values = torch.tensor(input_values, device=device).unsqueeze(0)
42
  logits = model(input_values).logits
43
  pred_ids = torch.argmax(logits, dim=-1)
44
+ #pred_ids= pred_ids[0].cpu().detach()
45
  return pred_ids
46
  #xcp = processor.decode(pred_ids)
47
  #return xcp
48
 
49
  def dec(pids):
50
  with torch.inference_mode():
51
+ xcp = processor.batch_decode(pids)
52
  return xcp
53
+ # decode torch.cat( pids ??
54
 
55
  bl = gr.Blocks()
56
  with bl: