Update README.md
Browse files
README.md
CHANGED
@@ -46,7 +46,7 @@ class GLiClassOnnxInference:
|
|
46 |
return np.array([ids], dtype=np.int64), np.array([mask], dtype=np.int64)
|
47 |
|
48 |
def onnx_predict(self, text: str, labels: list[str]):
|
49 |
-
full_text =
|
50 |
ids, mask = self.encode(full_text, max_length=512)
|
51 |
ort_inputs = {"input_ids": ids, "attention_mask": mask}
|
52 |
|
|
|
46 |
return np.array([ids], dtype=np.int64), np.array([mask], dtype=np.int64)
|
47 |
|
48 |
def onnx_predict(self, text: str, labels: list[str]):
|
49 |
+
full_text = "".join([f"<<LABEL>>{l}" for l in labels]) + "<<SEP>>" + text
|
50 |
ids, mask = self.encode(full_text, max_length=512)
|
51 |
ort_inputs = {"input_ids": ids, "attention_mask": mask}
|
52 |
|