Spaces:
Runtime error
Runtime error
Download app.py from kakuguo/testChatGLM3: direct link, hf CLI and curl.
- Browser
- Download file 352 Bytes
-
https://huggingface.co/spaces/kakuguo/testChatGLM3/resolve/main/app.py
- Command line
-
hf download hf://spaces/kakuguo/testChatGLM3/app.py
-
curl -L -o app.py https://huggingface.co/spaces/kakuguo/testChatGLM3/resolve/main/app.py
352 Bytes
| import gradio as gr | |
| from transformers import AutoTokenizer, AutoModel | |
| tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm3-6b", trust_remote_code=True) | |
| model = AutoModel.from_pretrained("THUDM/chatglm3-6b", trust_remote_code=True).half().cuda() | |
| model = model.eval() | |
| response, history = model.chat(tokenizer, "δ½ ε₯½", history=[]) | |
| print(response) | |