cybertron icon indicating copy to clipboard operation
cybertron copied to clipboard

Size Paragraph

Open devalexandre opened this issue 2 years ago • 1 comments

When I use a big paragraph, display a error

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x63cd47]

goroutine 1124 [running]:
github.com/nlpodyssey/spago/ag.Node.Value({0x0?, 0x0?})
	<autogenerated>:1 +0x27
github.com/nlpodyssey/spago/ag/fn.(*Add[...]).Forward(0xc8be40)
	/home/alexandre/pkg/mod/github.com/nlpodyssey/[email protected]/ag/fn/add.go:32 +0x83
github.com/nlpodyssey/spago/ag.(*Operator).forward(0xc01687cb40)
	/home/alexandre/pkg/mod/github.com/nlpodyssey/[email protected]/ag/operator.go:191 +0x2e
created by github.com/nlpodyssey/spago/ag.NewOperator
	/home/alexandre/pkg/mod/github.com/nlpodyssey/[email protected]/ag/operator.go:58 +0xee
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x63cd47]

goroutine 1122 [running]:
github.com/nlpodyssey/spago/ag.Node.Value({0x0?, 0x0?})
	<autogenerated>:1 +0x27
github.com/nlpodyssey/spago/ag/fn.(*Add[...]).Forward(0xc8be40)
	/home/alexandre/pkg/mod/github.com/nlpodyssey/[email protected]/ag/fn/add.go:32 +0x83
github.com/nlpodyssey/spago/ag.(*Operator).forward(0xc01687ca00)
	/home/alexandre/pkg/mod/github.com/nlpodyssey/[email protected]/ag/operator.go:191 +0x2e
created by github.com/nlpodyssey/spago/ag.NewOperator
	/home/alexandre/pkg/mod/github.com/nlpodyssey/[email protected]/ag/operator.go:58 +0xee
exit status 2

https://github.com/nlpodyssey/cybertron/blob/f7bd8ab1301cac254688d41c18129a5ca6a3942c/examples/questionanswering/main.go#L39

have some limit for size of paragraph?

devalexandre avatar Aug 09 '23 12:08 devalexandre

Hi @devalexandre yes we are constrained by the positional encoder max 512 token (tokens /= words).

Please update to the latest version and give it a try, it should log the error.

matteo-grella avatar Oct 31 '23 13:10 matteo-grella