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

Potentially open sourcing the model on HF and create a demo there? #2

Open
xianbaoqian opened this issue Jul 31, 2023 · 1 comment
Open

Comments

@xianbaoqian
Copy link

xianbaoqian commented Jul 31, 2023

Hi YuYang,

Congratulations on your great work! It would be really nice if you can upload the model to Hugging Face hub.

This would help model discovery and integration with tools.

For example, this is the ChatGLM repo on Hugging Face. https://huggingface.co/THUDM/chatglm2-6b
With that, the model can be invoked with a few lines of code.

from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True).half().cuda()
model = model.eval()
response, history = model.chat(tokenizer, "你好", history=[])
print(response)
你好👋!我是人工智能助手 ChatGLM-6B,很高兴见到你,欢迎问我任何问题。
response, history = model.chat(tokenizer, "晚上睡不着应该怎么办", history=history)
print(response)

Also you can fork nice demos like https://huggingface.co/spaces/mikeee/chatglm2-6b-4bit to create your own demos. It will make it very easy for users to use and amplify the impact of your project.

If you run into any issues, feel free to let us know and we're happy to help. :-) My WeChat ID is zhou_a_zhou

@Yu-Yang-Li
Copy link
Owner

Hi YuYang,

Congratulations on your great work! It would be really nice if you can upload the model to Hugging Face hub.

This would help model discovery and integration with tools.

For example, this is the ChatGLM repo on Hugging Face. https://huggingface.co/THUDM/chatglm2-6b With that, the model can be invoked with a few lines of code.

from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True).half().cuda()
model = model.eval()
response, history = model.chat(tokenizer, "你好", history=[])
print(response)
你好👋!我是人工智能助手 ChatGLM-6B,很高兴见到你,欢迎问我任何问题。
response, history = model.chat(tokenizer, "晚上睡不着应该怎么办", history=history)
print(response)

Also you can fork nice demos like https://huggingface.co/spaces/mikeee/chatglm2-6b-4bit to create your own demos. It will make it very easy for users to use and amplify the impact of your project.

If you run into any issues, feel free to let us know and we're happy to help. :-) My WeChat ID is zhou_a_zhou

We greatly appreciate your thoughtful suggestions!
Since there are model upload size limitations on github, we have been considering upload to HF.
And we are working on the RLHF of the model these days, and plan to organize new files and upload them to HuggingFace at that time.

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

No branches or pull requests

2 participants