Sorry I didn't make it clear.
The code pasted in the first issue works well after adopting your solution.
Then I tested 'gpt2' model, it reported an error:
```
TypeError: int() argument must be a string, a bytes-like object or a number,
not ‘Call’
```
The test code is shown below:
```
from tvm import relay
import torch
from pytorch_transformers import GPT2Tokenizer, GPT2LMHeadModel
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
text = "What is the fastest car in the"
indexed_tokens = tokenizer.encode(text)
tokens_tensor = torch.tensor([indexed_tokens])
model = GPT2LMHeadModel.from_pretrained('gpt2')
model.eval()
with torch.no_grad():
outputs = model(tokens_tensor)
predictions = outputs[0]
predicted_index = torch.argmax(predictions[0, -1, :]).item()
predicted_text = tokenizer.decode(indexed_tokens + [predicted_index])
print(predicted_text)
scripted_model = torch.jit.trace(model, tokens_tensor).eval()
input_name = 'input_ids'
input_shapes = [(input_name, [1, 7])]
mod, params = relay.frontend.from_pytorch(scripted_model, input_shapes)
```
---
[Visit
Topic](https://discuss.tvm.ai/t/problems-when-import-bert-model-from-pytorch-relay/6659/6)
to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click
here](https://discuss.tvm.ai/email/unsubscribe/5b0eab7fbacdc2444a4b437e5dde67b2a86a03c5004e1aad07f85a26918b8dad).