n1ck-guo commited on
Commit
6c0df1c
·
verified ·
1 Parent(s): 20d8e0e

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +87 -0
README.md ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - zai-org/GLM-4.5
4
+ pipeline_tag: text-generation
5
+ ---
6
+
7
+ ## Model Details
8
+
9
+ This model is an int4 model with group_size 128 and symmetric quantization of [zai-org/GLM-4.5](https://huggingface.co/zai-org/GLM-4.5) generated by [intel/auto-round](https://github.com/intel/auto-round) algorithm.
10
+ Please follow the license of the original model.
11
+
12
+ ## How To Use
13
+ ### vLLM usage
14
+ ```bash
15
+ VLLM_WORKER_MULTIPROC_METHOD=spawn python -m vllm.entrypoints.openai.api_server --port 8001 --trust-remote-code --tensor-parallel-size 4 --gpu-memory-utilization 0.90 --model Intel/GLM-4.5-int4-AutoRound --enable-expert-parallel --max-model-len 32768 --max-seq-len-to-capture 32768
16
+ ```
17
+
18
+ ### INT4 Inference
19
+ ```python
20
+ import torch
21
+ from transformers import AutoModelForCausalLM, AutoTokenizer
22
+
23
+ MODEL_PATH = "Intel/GLM-4.5-int4-AutoRound"
24
+ messages = [{"role": "user", "content": "Give me a short introduction to large language model."}]
25
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
26
+ inputs = tokenizer.apply_chat_template(
27
+ messages,
28
+ tokenize=True,
29
+ add_generation_prompt=True,
30
+ return_dict=True,
31
+ return_tensors="pt",
32
+ )
33
+ model = AutoModelForCausalLM.from_pretrained(
34
+ pretrained_model_name_or_path=MODEL_PATH,
35
+ torch_dtype=torch.bfloat16,
36
+ device_map="auto",
37
+ )
38
+ inputs = inputs.to(model.device)
39
+ inputs.pop("token_type_ids")
40
+ generated_ids = model.generate(**inputs, max_new_tokens=512, do_sample=False)
41
+ output_text = tokenizer.decode(generated_ids[0][inputs.input_ids.shape[1] :])
42
+ print(output_text)
43
+ """
44
+ <think>We are writing a short introduction to Large Language Models (LLMs).
45
+ The introduction should cover:
46
+ 1. What they are (definition and core concept)
47
+ 2. How they work (briefly, without too much technical detail)
48
+ 3. What they can do (applications)
49
+ 4. Why they are important (impact and significance)
50
+
51
+ Let's structure it in a few concise paragraphs.</think>A **Large Language Model (LLM)** is a type of artificial intelligence designed to understand, generate, and interact with human language at scale. Built using deep learning techniques—typically transformer architectures—LLMs are trained on vast datasets (e.g., books, articles, websites) to learn patterns, grammar, context, and even reasoning within text. By processing billions of parameters, they predict and produce coherent, contextually relevant responses to prompts, mimicking human-like communication.
52
+
53
+ LLMs power applications like chatbots (e.g., ChatGPT), translation tools, content creation, code generation, and summarization. Their versatility stems from their ability to generalize from training data, enabling tasks ranging from answering complex questions to drafting creative writing.
54
+
55
+ These models represent a leap in AI, transforming industries by automating language-based tasks, enhancing human-computer interaction, and accelerating research. However, they also raise challenges around accuracy, bias, and ethical use, making ongoing refinement and responsible deployment critical.<|user|>
56
+ """
57
+ ```
58
+
59
+ ### Generate the model
60
+ ```bash
61
+ auto_round --model zai-org/GLM-4.5 --ites 200 --low_gpu_mem_usage --group_size 128 --seqlen 512 --output_dir tmp_autoround
62
+ ```
63
+
64
+
65
+ ## Ethical Considerations and Limitations
66
+
67
+ The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
68
+
69
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
70
+
71
+ ## Caveats and Recommendations
72
+
73
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
74
+
75
+ Here are a couple of useful links to learn more about Intel's AI software:
76
+
77
+ - Intel Neural Compressor [link](https://github.com/intel/neural-compressor)
78
+
79
+ ## Disclaimer
80
+
81
+ The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
82
+
83
+ ## Cite
84
+
85
+ @article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }
86
+
87
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)