Files
AnesGLM/README.md
ModelHub XC 0c562d33f6 初始化项目,由ModelHub XC社区提供模型
Model: QiHongzhi/AnesGLM
Source: Original Platform
2026-05-13 19:29:35 +08:00

1.5 KiB
Raw Blame History

license, language, base_model, pipeline_tag
license language base_model pipeline_tag
apache-2.0
zh
THUDM/glm-4-9b
text-generation

AnesGLM is a large language model designed for anesthesiology question answering tasks in Chinese.

We develop AnesGLM, a Chinese large language model specialized for anesthesiology knowledge understanding and question answering. It is built upon THUDM/glm-4-9b and further adapted with domain-specific data from anesthesiology question answering and examination-style tasks. The model is designed to provide more accurate and professional responses for clinical anesthesiology education and knowledge-intensive QA scenarios.

How to use

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda"

tokenizer = AutoTokenizer.from_pretrained("QiHongzhi/AnesGLM", trust_remote_code=True)

query = "什么是肺泡最小有效浓度MAC"

inputs = tokenizer.apply_chat_template(
    [{"role": "user", "content": query}],
    add_generation_prompt=True,
    tokenize=True,
    return_tensors="pt",
    return_dict=True
)

inputs = inputs.to(device)

model = AutoModelForCausalLM.from_pretrained(
    "QiHongzhi/AnesGLM",
    torch_dtype=torch.bfloat16,
    low_cpu_mem_usage=True,
    trust_remote_code=True
).to(device).eval()

gen_kwargs = {"max_length": 512, "do_sample": True, "top_k": 1}

with torch.no_grad():
    outputs = model.generate(**inputs, **gen_kwargs)
    outputs = outputs[:, inputs["input_ids"].shape[1]:]
    print(tokenizer.decode(outputs[0], skip_special_tokens=True))