logo
Browse Source

Remove dc2 for towhee1.0

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 1 year ago
parent
commit
df54044de5
  1. 2
      README.md
  2. 2
      s_bert.py

2
README.md

@ -20,7 +20,7 @@ to generate a text embedding for the sentence "This is a sentence.".
*Write a pipeline with explicit inputs/outputs name specifications:*
```python
from towhee.dc2 import pipe, ops, DataCollection
from towhee import pipe, ops, DataCollection
p = (
pipe.input('sentence')

2
s_bert.py

@ -85,6 +85,8 @@ class STransformers(NNOperator):
else:
sentences = txt
inputs = self.tokenize(sentences)
for k, v in inputs.items():
inputs[k] = v.to(self.device)
embs = self.model(**inputs).cpu().detach().numpy()
if isinstance(txt, str):
embs = embs.squeeze(0)

Loading…
Cancel
Save