None1145/Theresa
Viewer • Updated • 389 • 17 • 1
How to use None1145/ChatGLM3-6B-Theresa with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="None1145/ChatGLM3-6B-Theresa") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("None1145/ChatGLM3-6B-Theresa", dtype="auto")How to use None1145/ChatGLM3-6B-Theresa with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "None1145/ChatGLM3-6B-Theresa"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "None1145/ChatGLM3-6B-Theresa",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/None1145/ChatGLM3-6B-Theresa
How to use None1145/ChatGLM3-6B-Theresa with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "None1145/ChatGLM3-6B-Theresa" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "None1145/ChatGLM3-6B-Theresa",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "None1145/ChatGLM3-6B-Theresa" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "None1145/ChatGLM3-6B-Theresa",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use None1145/ChatGLM3-6B-Theresa with Docker Model Runner:
docker model run hf.co/None1145/ChatGLM3-6B-Theresa
Configuration Parsing Warning:Config file config.json cannot be fetched (too big)
Configuration Parsing Warning:Config file tokenizer_config.json cannot be fetched (too big)
These models are based on the text training of Theresa from Arknights
>>> from transformers import AutoTokenizer, AutoModel
>>> tokenizer = AutoTokenizer.from_pretrained("None1145/ChatGLM3-6B-Theresa", trust_remote_code=True)
>>> model = AutoModel.from_pretrained("None1145/ChatGLM3-6B-Theresa", trust_remote_code=True).half().cuda()
>>> system_prompt = "请扮演特蕾西娅"
>>> response, history = model.chat(tokenizer, "你好", history=[])
>>> print(response)
现在我们出去走走,好吗?
>>> response, history = model.chat(tokenizer, "好啊,特蕾西娅小姐", history=history)
>>> print(response)
让我们到那片小草地上看看吧,阿米娅。