chejames commited on
Commit
0b7afc0
·
verified ·
1 Parent(s): 7a083cd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +96 -155
README.md CHANGED
@@ -1,199 +1,140 @@
1
  ---
 
 
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
 
 
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
 
 
 
 
9
 
 
10
 
 
11
 
12
- ## Model Details
13
 
14
- ### Model Description
 
 
 
 
 
 
 
15
 
16
- <!-- Provide a longer summary of what this model is. -->
 
17
 
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
 
19
 
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
 
28
- ### Model Sources [optional]
29
 
30
- <!-- Provide the basic links for the model. -->
31
 
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
 
36
- ## Uses
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
 
40
- ### Direct Use
 
 
41
 
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
 
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
 
153
- ## Technical Specifications [optional]
154
 
155
- ### Model Architecture and Objective
156
 
157
- [More Information Needed]
158
 
159
- ### Compute Infrastructure
 
 
160
 
161
- [More Information Needed]
162
 
163
- #### Hardware
 
 
164
 
165
- [More Information Needed]
 
166
 
167
- #### Software
 
 
168
 
169
- [More Information Needed]
170
 
171
- ## Citation [optional]
 
172
 
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
 
175
- **BibTeX:**
 
176
 
177
- [More Information Needed]
178
 
179
- **APA:**
180
 
181
- [More Information Needed]
182
 
183
- ## Glossary [optional]
 
 
184
 
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
 
 
 
186
 
187
- [More Information Needed]
 
 
188
 
189
- ## More Information [optional]
190
 
191
- [More Information Needed]
 
 
 
 
 
192
 
193
- ## Model Card Authors [optional]
194
 
195
- [More Information Needed]
196
 
197
- ## Model Card Contact
198
 
199
- [More Information Needed]
 
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
+ pipeline_tag: text-generation
4
  library_name: transformers
5
+ tags:
6
+ - vllm
7
+ - stem
8
+ language:
9
+ - en
10
+ base_model:
11
+ - HuggingFaceTB/SmolLM2-1.7B-Instruct
12
  ---
13
 
14
+ <p align="center">
15
+ <img alt="Omni 0 preview models header" src="https://github.com/omniomni-ai/omni-0-preview-models/raw/refs/heads/main/omni-0-preview-models-image.png">
16
+ </p>
17
 
18
+ <p align="center">
19
+ <a href="https://github.com/omniomni-ai"><strong>GitHub</strong></a> &nbsp
20
+ <a href="https://omniomni.framer.website/"><strong>Website</strong></a> &nbsp
21
+ <strong>Paper (Coming Soon)</strong>
22
+ </p>
23
 
24
+ <br>
25
 
26
+ # Omni 0 Preview Models
27
 
28
+ [Omni-0-Mini-Preview (Omni)](https://huggingface.co/omniomni/omni-0-mini-preview) is an 1.7-billion parameter model merged between 4 expert LLMs, each finetuned for expertise in STEM subfields: [Science Expert](https://huggingface.co/omniomni/omni-0-science-preview), [Technology Expert](https://huggingface.co/omniomni/omni-0-technology-preview), [Engineering Expert](https://huggingface.co/omniomni/omni-0-engineering-preview), [Math Expert](https://huggingface.co/omniomni/omni-0-math-preview). Through DARE-TIES merging, Omni is able to achieve state-of-the-art efficiency and domain benchmark results among alternative optimization techniques, as well as optimal compute-knowledge efficiency across similar models.
29
 
30
+ <p align="center">
31
+ <figure>
32
+ <img src="
33
+ https://github.com/omniomni-ai/omni-0-preview-models/raw/refs/heads/main/compute-knowledge-efficiency-plot.png"
34
+ alt="Omni compute-knowledge efficiency plot">
35
+ <figcaption>Omni achieves optimal compute-knowledge efficiency compared to alternative models</figcaption>
36
+ </figure>
37
+ </p>
38
 
39
+ # Models
40
+ Omni comes in a total of 5 models:
41
 
42
+ **Merged Model**
43
+ - `omni-0-mini-preview` - Merged output of all four experts through DARE-TIES, delivering large improvements in performance in STEM domains compared to its base.
44
 
45
+ **Experts**
46
+ - `omni-0-science-preview` - Science expert finetuned on corpora of scientific wikipedia texts and academic papers, as well as a chat-templated scientific Q&A dataset
47
+ - `omni-0-technology-preview` - Technology expert finetuned on chat-templated code generation data and stack exchange questions and top-voted answers
48
+ - `omni-0-engineering-preview` - Engineering expert finetuned on corpora of engineering-related wikipedia texts and academic papers
49
+ - `omni-0-math-preview` - Math expert finetuned on chat-templated math Q&A data
 
 
50
 
51
+ All Omni experts are finetuned from their base model: [SmolLM2 1.7B Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-1.7B-Instruct) on H100/Ada 6000/A100 GPUs, improving by 25.32% on average over all tested STEM benchmarks.
52
 
53
+ > This model card is for [omni-0-mini-preview](https://huggingface.co/omniomni/omni-0-mini-preview). All other models can be found on [Omni's HuggingFace page](https://huggingface.co/omniomni)
54
 
55
+ # Features
 
 
56
 
57
+ **Made for all** Omni is a series of highly efficient Large Language Models aimed at expanding the accessibility of AI fill in the gaps left behind by technological advancement.
58
 
59
+ **Efficient** Omni operates at optimal compute-knowledge efficiency compared to similar models.
60
 
61
+ **Merged architecture** Omni uses merging to provide the collective accuracy of specialized models, leveraging their capabilities to collectively enhance the final merged model.
62
+
63
+ **Multi-disciplinary** Omni's first variant achieves state-of-the-art performance across STEM compared to alternative optimization techniques.
64
 
65
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
+ # Inference
 
 
 
 
68
 
69
+ ## Transformers
70
 
71
+ Transformers is a framework by HuggingFace unifying model development and inference, allowing for simple and seamless interactions with models found on HuggingFace.
72
 
73
+ To get started with running inference using Omni, install transformers
74
 
75
+ ```bash
76
+ pip install transformers
77
+ ```
78
 
79
+ After transformers has been installed, run the following code to generate outputs from any Omni model
80
 
81
+ ```python
82
+ from transformers import AutoModelForCausalLM, AutoTokenizer
83
+ checkpoint = "omniomni/omni-0-mini-preview" # Can be any Omni model
84
 
85
+ device = "cuda" # For GPU usage or "cpu" for CPU usage
86
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
87
 
88
+ # For multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
89
+ # However, Omni is small enough to run on individual commodity GPUs and low-resource devices
90
+ model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
91
 
92
+ messages = [{"role": "user", "content": "What is STEM?"}]
93
 
94
+ input_text=tokenizer.apply_chat_template(messages, tokenize=False)
95
+ inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
96
 
97
+ outputs = model.generate(inputs, max_new_tokens=256, temperature=0.7, do_sample=True)
98
 
99
+ print(tokenizer.decode(outputs[0]))
100
+ ```
101
 
102
+ ## vLLM
103
 
104
+ vLLM provides fast LLM inference to models spanning vast amounts of architectures through both server and in-file implementations.
105
 
106
+ First, install vLLM's package
107
 
108
+ ```bash
109
+ uv pip install vllm --torch-backend=auto
110
+ ```
111
 
112
+ After that, run this command to start a server with Omni via vLLM
113
+ ```bash
114
+ vllm serve omniomni/omni-0-mini-preview
115
+ ```
116
 
117
+ To use Omni with vLLM without creating a server, run this code to generate outputs within a Python file
118
+ ```python
119
+ # vLLM automatically uses a GPU unless built with CPU wheels, so no need to specify a device
120
 
121
+ from vllm import LLM, SamplingParams
122
 
123
+ prompts = [
124
+ "Hello, my name is",
125
+ "The president of the United States is",
126
+ "The capital of France is",
127
+ "The future of AI is",
128
+ ]
129
 
130
+ sampling_params = SamplingParams(temperature=0.7)
131
 
132
+ llm = LLM(model="omniomni/omni-0-mini-preview")
133
 
134
+ outputs = llm.generate(prompts, sampling_params)
135
 
136
+ for output in outputs:
137
+ prompt = output.prompt
138
+ generated_text = output.outputs[0].text
139
+ print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
140
+ ```