robertgshaw2 commited on
Commit
c5218f8
·
verified ·
1 Parent(s): 7236431

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +55 -0
README.md ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: NousResearch/Nous-Hermes-2-Yi-34B
3
+ inference: true
4
+ model_type: yi
5
+ quantized_by: robertgshaw2
6
+ tags:
7
+ - nm-vllm
8
+ - marlin
9
+ - int4
10
+ ---
11
+
12
+ ## Nous-Hermes-Yi-34B-marlin
13
+ This repo contains model files for [Nous-Hermes-2-Yi-34B](https://huggingface.co/NousResearch/Nous-Hermes-2-Yi-34B) optimized for [nm-vllm](https://github.com/neuralmagic/nm-vllm), a high-throughput serving engine for compressed LLMs.
14
+
15
+ This model was quantized with [GPTQ](https://arxiv.org/abs/2210.17323) and saved in the Marlin format for efficient 4-bit inference. Marlin is a highly optimized inference kernel for 4 bit models.
16
+
17
+ ## Inference
18
+ Install [nm-vllm](https://github.com/neuralmagic/nm-vllm) for fast inference and low memory-usage:
19
+ ```bash
20
+ pip install nm-vllm[sparse]
21
+ ```
22
+
23
+ Run in a Python pipeline for local inference:
24
+ ```python
25
+ from transformers import AutoTokenizer
26
+ from vllm import LLM, SamplingParams
27
+
28
+ model_id = "neuralmagic/Nous-Hermes-2-Yi-34B-marlin"
29
+ model = LLM(model_id)
30
+
31
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
32
+ messages = [
33
+ {"role": "user", "content": "What is synthetic data in machine learning?"},
34
+ ]
35
+ formatted_prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
36
+ sampling_params = SamplingParams(max_tokens=200)
37
+ outputs = model.generate(formatted_prompt, sampling_params=sampling_params)
38
+ print(outputs[0].outputs[0].text)
39
+
40
+ """
41
+ Synthetic data is data that has been artificially created or modified to serve the needs of machine learning and data analysis tasks. It can be generated either through title methods like stochastic simulations or through processes of data augmentation that take original data and modify/manipulate it to create new samples. Synthetic data is often used in machine learning when the available amount of real-world data is insufficient or in cases where the creation of real-world data can be dangerous, costly, or time-consuming.
42
+ """
43
+ ```
44
+
45
+ ## Quantization
46
+ For details on how this model was quantized and converted to marlin format, run the `quantization/apply_gptq_save_marlin.py` script:
47
+
48
+ ```bash
49
+ pip install -r quantization/requirements.txt
50
+ python3 quantization/apply_gptq_save_marlin.py --model-id NousResearch/Nous-Hermes-2-Yi-34B --save-dir ./nous-hermes-2-yi-34b-marlin
51
+ ```
52
+
53
+ ## Slack
54
+
55
+ For further support, and discussions on these models and AI in general, join [Neural Magic's Slack Community](https://join.slack.com/t/discuss-neuralmagic/shared_invite/zt-q1a1cnvo-YBoICSIw3L1dmQpjBeDurQ)