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

[Feature Request] rinna's Japanese GPT model support #33

Open
katsu560 opened this issue Mar 4, 2023 Discussed in #32 · 2 comments
Open

[Feature Request] rinna's Japanese GPT model support #33

katsu560 opened this issue Mar 4, 2023 Discussed in #32 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@katsu560
Copy link
Contributor

katsu560 commented Mar 4, 2023

Thanks @ggerganov for your sharing.

I want to use GPT on my local pc.
rinna Co.,Ltd is Japanese AI company. rinna provides some GPT models on huggingface.
https://huggingface.co/rinna/japanese-gpt-1b
https://huggingface.co/rinna/japanese-gpt2-xsmall
https://huggingface.co/rinna/japanese-gpt2-small
https://huggingface.co/rinna/japanese-gpt2-medium
I'd like to use these models with ggml gpt.
But, I can't convert these models for ggml.
I think these models are pytorch bin model and tensorflow H5 weight.

Could you convert and support these models ?

@katsu560 katsu560 changed the title rinna's Japanese GPT model support [Feature Request] rinna's Japanese GPT model support Mar 4, 2023
@ggerganov ggerganov added enhancement New feature or request good first issue Good for newcomers labels Mar 6, 2023
@ocordeiro
Copy link
Contributor

You can use examples/gpt-2/convert-h5-to-ggml.py to convert these models:

PR #35

@katsu560
Copy link
Contributor Author

katsu560 commented Apr 6, 2023

Thank you for your comment, ocordeiro.
I sync-ed to new master branch code and then did gpt-2/convert-h5-to-ggml.py.
But, unfortunately, rinna's gpt-2 model has no vocab.json and added_tokens.json.
So, the conversion was failed.

Traceback (most recent call last):
  File "../examples/gpt-2/convert-h5-to-ggml.py", line 58, in <module>
    with open(dir_model + "/vocab.json", "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/g/gpt/rinna-gpt-2/medium//vocab.json'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "../examples/gpt-2/convert-h5-to-ggml.py", line 58, in <module>
    with open(dir_model + "/vocab.json", "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/g/gpt/rinna-gpt-2/medium//vocab.json'

I'm sorry for no understanding the model file's detail.
rinna's x-small model's files as follows.

-rwxrwxrwx 1 user user       845 Feb 19 00:13 config.json
-rwxrwxrwx 1 user user       737 Feb 19 00:14 gitattributes.txt
-rwxrwxrwx 1 user user 155916167 Feb 19 00:14 pytorch_model.bin
-rwxrwxrwx 1 user user     60349 Feb 19 00:13 rinna.png
-rwxrwxrwx 1 user user       153 Feb 19 00:13 special_tokens_map.json
-rwxrwxrwx 1 user user    805634 Feb 19 00:13 spiece.model
-rwxrwxrwx 1 user user 149686584 Feb 19 00:13 tf_model.h5
-rwxrwxrwx 1 user user       282 Feb 19 00:13 tokenizer_config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants