Views
No views yet
<think> tag, and output natural, clean clinical TCM analyses outside the <think> tag.1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "zsyjsld/Xinghe1-9B"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype="auto")
6
7prompt = "In the process of warm disease, the patient's fever does not recede after sweating, but rises again. The pulse is rapid and restless and does not subside with sweating. It is accompanied by wild talk and inability to eat. This pattern is called Yin-Yang Separation (Yin Yang Jiao). What is the underlying mechanism of life-death transition?"
8messages = [
9 {"role": "user", "content": prompt}
10]
11text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
12model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
13
14generated_ids = model.generate(**model_inputs, max_new_tokens=1024)
15response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
16print(response)1@misc{xinghe1_9b,
2 author = {zsyjsld},
3 title = {Xinghe1-9B: Formally Modeling Huangdi Neijing},
4 year = {2026},
5 publisher = {Hugging Face / ModelScope},
6 howpublished = {\url{https://huggingface.co/zsyjsld/Xinghe1-9B}}
7}