MCS12 commited on
Commit
6530b7a
·
verified ·
1 Parent(s): 6425c90

Upload handler.py

Browse files
Files changed (1) hide show
  1. handler.py +2 -1
handler.py CHANGED
@@ -72,7 +72,8 @@ class EndpointHandler:
72
  )
73
 
74
  prediction = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
75
- start_index = prediction.find("<presentation>")
 
76
  end_index = prediction.find("</presentation>") + 15
77
  prediction = prediction[start_index:end_index]
78
 
 
72
  )
73
 
74
  prediction = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
75
+ start_indices = positions = [i for i in range(len(prediction)) if s.startswith("<presentation>", i)]
76
+ start_index = start_indices[-1]
77
  end_index = prediction.find("</presentation>") + 15
78
  prediction = prediction[start_index:end_index]
79