cybertron icon indicating copy to clipboard operation
cybertron copied to clipboard

Guidelines to support new models

Open Bornholm opened this issue 2 years ago • 3 comments

First of all, thank you for this amazing project !

For a prototype of mine, i would like to be able to use this model from huggingfaces with the cybertron server.

I understand i should add support for the camembert model and i naively started to modify pkg/downloader/downloadmodel.go and pkg/converter/converter.go to be able to download/try to convert this model.

But i'm stuck at this error now:

[user] (main)$ go run ./cmd/server
2023-01-07T11:29:31-06:00 DBG model file already exists, skipping download file=models/Jean-Baptiste/camembert-ner-with-dates/config.json
2023-01-07T11:29:31-06:00 DBG model file already exists, skipping download file=models/Jean-Baptiste/camembert-ner-with-dates/pytorch_model.bin
2023-01-07T11:29:31-06:00 DBG model file already exists, skipping download file=models/Jean-Baptiste/camembert-ner-with-dates/sentencepiece.bpe.model
2023-01-07T11:29:31-06:00 DBG model file already exists, skipping download file=models/Jean-Baptiste/camembert-ner-with-dates/special_tokens_map.json
2023-01-07T11:29:31-06:00 DBG model file already exists, skipping download file=models/Jean-Baptiste/camembert-ner-with-dates/tokenizer_config.json
panic: runtime error: slice bounds out of range [:768] with capacity 0

goroutine 1 [running]:
github.com/nlpodyssey/cybertron/pkg/converter/bert.mapBaseModel[...]({{0xc00036e5c0, 0x1, 0x4}, 0x3fb999999999999a, 0x0, {0xc00012de64, 0x4}, 0x3fb999999999999a, 0x300, 0x300, ...}, ...)
	/home/wpetit/workspace/cybertron/pkg/converter/bert/convert.go:177 +0x5c9
github.com/nlpodyssey/cybertron/pkg/converter/bert.Convert[...]({0xc00013ecc0, 0x2d}, 0x0)
	/home/wpetit/workspace/cybertron/pkg/converter/bert/convert.go:101 +0x75e
github.com/nlpodyssey/cybertron/pkg/converter.Convert[...]({0xc00013ecc0, 0x2d}, 0x15)
	/home/wpetit/workspace/cybertron/pkg/converter/converter.go:31 +0x188
github.com/nlpodyssey/cybertron/pkg/tasks.loader[...].convert({{{0xc00013cb15, 0x6}, {0xc000160b10, 0x26}, {0x0, 0x0}, 0x0, 0x0, 0x0}})
	/home/wpetit/workspace/cybertron/pkg/tasks/loader.go:278 +0x118
github.com/nlpodyssey/cybertron/pkg/tasks.loader[...].load({{{0xc00013cb15, 0x6}, {0xc000160b10, 0x26}, {0x0, 0x0}, 0x0, 0x0, 0x0}})
	/home/wpetit/workspace/cybertron/pkg/tasks/loader.go:91 +0x11d
github.com/nlpodyssey/cybertron/pkg/tasks.Load[...](...)
	/home/wpetit/workspace/cybertron/pkg/tasks/loader.go:44
main.loadModelForTask(0xc00014b720)
	/home/wpetit/workspace/cybertron/cmd/server/main.go:96 +0x565
main.run()
	/home/wpetit/workspace/cybertron/cmd/server/main.go:68 +0x253
main.main()
	/home/wpetit/workspace/cybertron/cmd/server/main.go:35 +0x19
exit status 2

Are there some guidelines i could follow to add support to new models in cybertron ? I would be happy to work on somes PRs :smile:

Thanks in advance !

Bornholm avatar Jan 07 '23 21:01 Bornholm

Hi,

I'm interested too. Is there a guidelines or the possibility to learn how the library works ?

Regards

ior308 avatar Sep 11 '23 09:09 ior308

@ior308 Unless you read the code and write it yourself I don't see this happening. Advances/improvements in this area are moving too fast to keep up. Development seems halted in favor of Fortran (which, in my opinion, seems like wasted contributions but I'm sure people who use Fortran are happy).

mooijtech avatar Sep 11 '23 10:09 mooijtech

Yes, it in an ever-changing world, but before I need help to make up the time I missed :)

Ok, I'll take a look at the code...

Regards

.

ior308 avatar Sep 11 '23 13:09 ior308