huggingface / swift-transformers

Swift Package to implement a transformers-like API in Swift
Apache License 2.0
675 stars 69 forks source link

NSCocoaErrorDomain Code = 3840 #17

Open Leung-Kam-Ho opened 1 year ago

Leung-Kam-Ho commented 1 year ago

I use exporters to convert gpt2-xl, gpt2-large and MBZUAI/LaMini-GPT-1.5B with —feature=text-generation , then loaded into swift-chat and try to generate text, gpt2-large and gpt2-xl are fine,

But received error while trying out MBZUAI/LaMini-GPT-1.5B. “”” Error: Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0., NSJSONSerializationErrorIndex=0} “””

pcuenca commented 1 year ago

Interesting, I took a quick look at the json files in the model configuration but did not notice anything wrong.

I'll perform the conversion to try to reproduce. Did you happen to push your converted model to the Hub so I could use it instead?

Leung-Kam-Ho commented 1 year ago

Seems to be the problem of exporters .

I've tried to convert the same model (MBZUAI/LaMini-GPT-1.5B)again with same method, and somehow there is no error, everything is fine.

But still, I converted a different model Aira-Instruct-774M four times, all passing the validation in exporters, but still error in swift-transformer

pushed the broken model to HuggingFace

markwitt1 commented 1 year ago

@Leung-Kam-Ho Would you mind uploading the succeeded converted model of LaMini-GPT-1.5B to HuggingFace too? Would greatly appreciate it

Leung-Kam-Ho commented 1 year ago

@teknoalex I uploaded the success conversion LaMini-GPT-1.5B-coreML to HF, check out if you are interested