Skip to content

Commit

Permalink
[Release] New v0.2.0 release (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
cenyk1230 committed Jan 12, 2021
1 parent 0552573 commit c897d79
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ visual("cora", seed=0, depth=3)

# load OAGBert model and perform inference
oagbert = pipeline("oagbert")
outputs = oagbert("CogDL is developed by KEG, Tsinghua.")
outputs = oagbert(["CogDL is developed by KEG, Tsinghua.", "OAGBert is developed by KEG, Tsinghua."])
```

### Command-Line Usage
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ visual("cora", seed=0, depth=3)

# load OAGBert model and perform inference
oagbert = pipeline("oagbert")
outputs = oagbert("CogDL is developed by KEG, Tsinghua.")
outputs = oagbert(["CogDL is developed by KEG, Tsinghua.", "OAGBert is developed by KEG, Tsinghua."])
```


Expand Down
2 changes: 1 addition & 1 deletion cogdl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.2"
__version__ = "0.2.0"

from .experiments import experiment
from .oag import oagbert
Expand Down
2 changes: 1 addition & 1 deletion cogdl/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __init__(self, app: str, model: str, **kwargs):
self.tokenizer, self.bert_model = oagbert(model, load_weights=load_weights)

def __call__(self, sequence, **kwargs):
tokens = self.tokenizer(sequence, return_tensors="pt")
tokens = self.tokenizer(sequence, return_tensors="pt", padding=True)
outputs = self.bert_model(**tokens)

return outputs
Expand Down
4 changes: 2 additions & 2 deletions examples/oagbert.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

tokenizer, bert_model = oagbert()

sequence = "CogDL is developed by KEG, Tsinghua."
tokens = tokenizer(sequence, return_tensors="pt")
sequence = ["CogDL is developed by KEG, Tsinghua.", "OAGBert is developed by KEG, Tsinghua."]
tokens = tokenizer(sequence, return_tensors="pt", padding=True)
outputs = bert_model(**tokens)

print(outputs[0].shape)
2 changes: 1 addition & 1 deletion examples/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

# load OAGBert model and perform inference
oagbert = pipeline("oagbert")
outputs = oagbert("CogDL is developed by KEG, Tsinghua.")
outputs = oagbert(["CogDL is developed by KEG, Tsinghua.", "OAGBert is developed by KEG, Tsinghua."])

0 comments on commit c897d79

Please sign in to comment.