SSON9 commited on
Commit
ff17f06
·
verified ·
1 Parent(s): c03acad

Fix the license of Solar modeling and inference code.

Browse files

Corrected the license of `configuration_solar_open.py` and `modeling_solar_open.py` to Apache 2.0, as they are derived from `transformers`.

README.md CHANGED
@@ -18,7 +18,7 @@ tags:
18
 
19
  # **Solar Open**
20
 
21
- **Solar Open** is Upstage's flagship **102B-parameter** large language model, trained **entirely from scratch** and released under the **Solar-Apache License 2.0** (see [LICENSE](./LICENSE)). As a **Mixture-of-Experts (MoE)** architecture, it delivers enterprise-grade performance in reasoning, instruction-following, and agentic capabilities—all while prioritizing transparency and customization for the open-source community.
22
 
23
  ## Highlights
24
 
@@ -40,6 +40,18 @@ tags:
40
  * **Hardware Requirements:**
41
  * **Minimum:** 4x NVIDIA A100 (80GB)
42
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  ## Performance
44
 
45
  TBA
@@ -77,7 +89,6 @@ model = AutoModelForCausalLM.from_pretrained(
77
  pretrained_model_name_or_path=MODEL_ID,
78
  torch_dtype=torch.bfloat16,
79
  device_map="auto",
80
- trust_remote_code=True,
81
  )
82
 
83
  # Prepare input
@@ -99,6 +110,7 @@ generated_ids = model.generate(
99
  top_p=0.95,
100
  top_k=50,
101
  do_sample=True,
 
102
  )
103
  generated_text = tokenizer.decode(generated_ids[0][inputs.input_ids.shape[1] :])
104
  print(generated_text)
@@ -168,7 +180,7 @@ If you use Solar Open in your research, please cite:
168
 
169
  ```bibtex
170
  @misc{solar-open-2025,
171
- title={Solar Open 100B},
172
  author={Upstage AI},
173
  year={2025},
174
  url={https://huggingface.co/Upstage/Solar-Open-100B}
 
18
 
19
  # **Solar Open**
20
 
21
+ **Solar Open** is Upstage's flagship **102B-parameter** large language model, trained **entirely from scratch** and released under the **Solar-Apache License 2.0** (see [LICENSE](#LICENSE) for details). As a **Mixture-of-Experts (MoE)** architecture, it delivers enterprise-grade performance in reasoning, instruction-following, and agentic capabilities—all while prioritizing transparency and customization for the open-source community.
22
 
23
  ## Highlights
24
 
 
40
  * **Hardware Requirements:**
41
  * **Minimum:** 4x NVIDIA A100 (80GB)
42
 
43
+ ## License
44
+ This repository contains both model weights and code,
45
+ which are licensed under different terms:
46
+
47
+ 1. MODEL WEIGHTS (*.safetensors)
48
+ Licensed under **Solar-Apache License 2.0**
49
+ See: https://huggingface.co/upstage/Solar-Open-100B/blob/main/LICENSE
50
+
51
+ 2. CODE (*.py, *.json, *.jinja files)
52
+ Licensed under **Apache License 2.0**
53
+ See: https://www.apache.org/licenses/LICENSE-2.0
54
+
55
  ## Performance
56
 
57
  TBA
 
89
  pretrained_model_name_or_path=MODEL_ID,
90
  torch_dtype=torch.bfloat16,
91
  device_map="auto",
 
92
  )
93
 
94
  # Prepare input
 
110
  top_p=0.95,
111
  top_k=50,
112
  do_sample=True,
113
+ trust_remote_code=True,
114
  )
115
  generated_text = tokenizer.decode(generated_ids[0][inputs.input_ids.shape[1] :])
116
  print(generated_text)
 
180
 
181
  ```bibtex
182
  @misc{solar-open-2025,
183
+ title={Solar Open: Scaling Upstage's LLM Capabilities with MoE},
184
  author={Upstage AI},
185
  year={2025},
186
  url={https://huggingface.co/Upstage/Solar-Open-100B}
configuration_solar_open.py CHANGED
@@ -1,17 +1,24 @@
1
  # coding=utf-8
2
- # Copyright 2025 Upstage AI. All rights reserved.
 
3
  #
4
- # Licensed under the Solar-Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
6
  # You may obtain a copy of the License at
7
  #
8
- # https://huggingface.co/upstage/Solar-Open-100B/blob/main/LICENSE
9
  #
10
  # Unless required by applicable law or agreed to in writing, software
11
  # distributed under the License is distributed on an "AS IS" BASIS,
12
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
  # See the License for the specific language governing permissions and
14
  # limitations under the License.
 
 
 
 
 
 
15
 
16
  from transformers.configuration_utils import PretrainedConfig
17
  from transformers.modeling_rope_utils import rope_config_validation
 
1
  # coding=utf-8
2
+ # Copyright 2025 Upstage AI.
3
+ # Copyright 2025 The ZhipuAI Inc. team and HuggingFace Inc. team.
4
  #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
  # you may not use this file except in compliance with the License.
7
  # You may obtain a copy of the License at
8
  #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
  #
11
  # Unless required by applicable law or agreed to in writing, software
12
  # distributed under the License is distributed on an "AS IS" BASIS,
13
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  # See the License for the specific language governing permissions and
15
  # limitations under the License.
16
+ #
17
+ # This file has been modified by Upstage AI including
18
+ # - Hyperparameter Adjustments: Modified the model architecture by increasing vocab_size and num_hidden_layers, while decreasing num_attention_heads, intermediate_size, and moe_intermediate_size.
19
+ # RoPE Configuration: Replaced the generic rope_parameters argument with explicit rope_theta and rope_scaling parameters to define Rotary Positional Embeddings settings.
20
+ #
21
+ # Based on code from: https://github.com/huggingface/transformers/blob/main/src/transformers/models/glm4_moe/configuration_glm4_moe.py
22
 
23
  from transformers.configuration_utils import PretrainedConfig
24
  from transformers.modeling_rope_utils import rope_config_validation
modeling_solar_open.py CHANGED
@@ -1,17 +1,25 @@
1
  # coding=utf-8
2
- # Copyright 2025 Upstage AI. All rights reserved.
 
3
  #
4
- # Licensed under the Solar-Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
6
  # You may obtain a copy of the License at
7
  #
8
- # https://huggingface.co/upstage/Solar-Open-100B/blob/main/LICENSE
9
  #
10
  # Unless required by applicable law or agreed to in writing, software
11
  # distributed under the License is distributed on an "AS IS" BASIS,
12
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
  # See the License for the specific language governing permissions and
14
  # limitations under the License.
 
 
 
 
 
 
 
15
 
16
  from typing import Callable, Optional, Union
17
 
 
1
  # coding=utf-8
2
+ # Copyright 2025 Upstage AI.
3
+ # Copyright 2025 The GLM4 & ZhipuAI team and HuggingFace Inc. team.
4
  #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
  # you may not use this file except in compliance with the License.
7
  # You may obtain a copy of the License at
8
  #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
  #
11
  # Unless required by applicable law or agreed to in writing, software
12
  # distributed under the License is distributed on an "AS IS" BASIS,
13
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  # See the License for the specific language governing permissions and
15
  # limitations under the License.
16
+ #
17
+ # This file has been modified by Upstage AI including:
18
+ # - Hybrid MoE Architecture: Replaced the standard dense structure with a depth-dependent Hybrid MoE, adding `SolarOpenMoE` and `SolarOpenTopkRouter` classes.
19
+ # - RoPE Strategy: Changed the rotary position embedding strategy from GLM4's interleaved rotation to Llama-style block rotation (via modified `rotate_half`).
20
+ # - Normalization Logic: Simplified the layer normalization structure by removing GLM4's extra post-operation norms and adding optional Query-Key Normalization (`use_qk_norm`).
21
+ #
22
+ # Based on code from: https://github.com/huggingface/transformers/blob/main/src/transformers/models/glm4/modeling_glm4.py
23
 
24
  from typing import Callable, Optional, Union
25
 
parallel_tool_call_logits_processor.py CHANGED
@@ -1,11 +1,11 @@
1
  # coding=utf-8
2
- # Copyright 2025 Upstage AI. All rights reserved.
3
  #
4
- # Licensed under the Solar-Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
6
  # You may obtain a copy of the License at
7
  #
8
- # https://huggingface.co/upstage/Solar-Open-100B/blob/main/LICENSE
9
  #
10
  # Unless required by applicable law or agreed to in writing, software
11
  # distributed under the License is distributed on an "AS IS" BASIS,
 
1
  # coding=utf-8
2
+ # Copyright 2025 Upstage AI.
3
  #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
6
  # You may obtain a copy of the License at
7
  #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
  #
10
  # Unless required by applicable law or agreed to in writing, software
11
  # distributed under the License is distributed on an "AS IS" BASIS,
solar_open_logits_processor.py CHANGED
@@ -1,11 +1,11 @@
1
  # coding=utf-8
2
- # Copyright 2025 Upstage AI. All rights reserved.
3
  #
4
- # Licensed under the Solar-Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
6
  # You may obtain a copy of the License at
7
  #
8
- # https://huggingface.co/upstage/Solar-Open-100B/blob/main/LICENSE
9
  #
10
  # Unless required by applicable law or agreed to in writing, software
11
  # distributed under the License is distributed on an "AS IS" BASIS,
 
1
  # coding=utf-8
2
+ # Copyright 2025 Upstage AI.
3
  #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
6
  # You may obtain a copy of the License at
7
  #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
  #
10
  # Unless required by applicable law or agreed to in writing, software
11
  # distributed under the License is distributed on an "AS IS" BASIS,
solar_open_reasoning_parser.py CHANGED
@@ -1,11 +1,11 @@
1
  # coding=utf-8
2
- # Copyright 2025 Upstage AI. All rights reserved.
3
  #
4
- # Licensed under the Solar-Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
6
  # You may obtain a copy of the License at
7
  #
8
- # https://huggingface.co/upstage/Solar-Open-100B/blob/main/LICENSE
9
  #
10
  # Unless required by applicable law or agreed to in writing, software
11
  # distributed under the License is distributed on an "AS IS" BASIS,
 
1
  # coding=utf-8
2
+ # Copyright 2025 Upstage AI.
3
  #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
6
  # You may obtain a copy of the License at
7
  #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
  #
10
  # Unless required by applicable law or agreed to in writing, software
11
  # distributed under the License is distributed on an "AS IS" BASIS,
solar_open_tool_parser.py CHANGED
@@ -1,11 +1,11 @@
1
  # coding=utf-8
2
- # Copyright 2025 Upstage AI. All rights reserved.
3
  #
4
- # Licensed under the Solar-Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
6
  # You may obtain a copy of the License at
7
  #
8
- # https://huggingface.co/upstage/Solar-Open-100B/blob/main/LICENSE
9
  #
10
  # Unless required by applicable law or agreed to in writing, software
11
  # distributed under the License is distributed on an "AS IS" BASIS,
 
1
  # coding=utf-8
2
+ # Copyright 2025 Upstage AI.
3
  #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
6
  # You may obtain a copy of the License at
7
  #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
  #
10
  # Unless required by applicable law or agreed to in writing, software
11
  # distributed under the License is distributed on an "AS IS" BASIS,