Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch back to gpt2 512 model. Fixes gibberish gpt2 output #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

djsamseng
Copy link

Switches back to the GPT2 512 model that was used for the demo on the README. While slower, the results match the quality of the README's demo.

Current (distilgpt2_64_6) These changes (gpt2_512)
distilgpt2_64_6 gpt2_512
distilgpt2_64_6 gpt2_512
distilgpt2_64_6 gpt2_512

@realcarlos
Copy link

Hi , I want to try:

private let model = gpt2_512()
public let tokenizer = GPT2Tokenizer()
public let seqLen = 512

but got errors, could you help to tell the what I should do?
/Users/xxx/swift-coreml-transformers/Sources/GPT2.swift:29:25 Cannot find 'gpt2_512' in scope

@djsamseng
Copy link
Author

Hi , I want to try:

private let model = gpt2_512()
public let tokenizer = GPT2Tokenizer()
public let seqLen = 512

but got errors, could you help to tell the what I should do? /Users/xxx/swift-coreml-transformers/Sources/GPT2.swift:29:25 Cannot find 'gpt2_512' in scope

Hello!
Did you add the model to the project/build? https://github.com/huggingface/swift-coreml-transformers/pull/29/files#diff-2d85bd611302dc0e5de877b114c903d4047fccb7312ce3f9125b52bfc3144194R71

@realcarlos
Copy link

Hi , I want to try:

private let model = gpt2_512()
public let tokenizer = GPT2Tokenizer()
public let seqLen = 512

but got errors, could you help to tell the what I should do? /Users/xxx/swift-coreml-transformers/Sources/GPT2.swift:29:25 Cannot find 'gpt2_512' in scope

Hello! Did you add the model to the project/build? https://github.com/huggingface/swift-coreml-transformers/pull/29/files#diff-2d85bd611302dc0e5de877b114c903d4047fccb7312ce3f9125b52bfc3144194R71

yes, I have the model , it seems I missed the file which having gpt2_512() , could you tell me which file I should add?

@djsamseng
Copy link
Author

@realcarlos
Copy link

Should be this one https://github.com/huggingface/swift-coreml-transformers/blob/master/Resources/gpt2-512.mlmodel

I add this file to Compile Sources, but still failed:

2023-05-18 21:51:38.157876+0800 CoreMLGPT2[38603:9307067] Metal API Validation Enabled
2023-05-18 21:51:51.294500+0800 CoreMLGPT2[38603:9307067] [espresso] [Espresso::handle_ex_plan] exception=ANECF error: failed to load ANE model. Error=ANECCompile(/var/mobile/Library/Caches/com.apple.aned/tmp/ai.katia.Katia.CoreMLGPT2/6F284D8730500443BBF24C75BC12B6C3C41CC90940F082B78438ACA25771C66B/1D4509F6B6CDC93B38ECBC87E6282B6193403F9DA75BD53D25DD3A58D2AC3AE1/) FAILED: err=(
CompilationFailure
)
2023-05-18 21:51:51.296062+0800 CoreMLGPT2[38603:9307067] [coreml] Error plan build: -1.
2023-05-18 21:51:51.308255+0800 CoreMLGPT2[38603:9307067] [client] doUnloadModel:options:qos:error:: nil _ANEModel
2023-05-18 21:51:51.308282+0800 CoreMLGPT2[38603:9307067] [espresso] ANECF error:

@kpacholak
Copy link

+1 from me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants