GangJiang commited on
Commit
4e36e28
·
verified ·
1 Parent(s): b19d32d

Upload 2 files

Browse files
Files changed (2) hide show
  1. Agent_Inference.ipynb +523 -0
  2. README.md +257 -3
Agent_Inference.ipynb ADDED
@@ -0,0 +1,523 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "metadata": {
7
+ "executionInfo": {
8
+ "elapsed": 4534,
9
+ "status": "ok",
10
+ "timestamp": 1745783879773,
11
+ "user": {
12
+ "displayName": "Gang Jiang",
13
+ "userId": "14372238440999662262"
14
+ },
15
+ "user_tz": 360
16
+ },
17
+ "id": "U6wJ62qjwPz8"
18
+ },
19
+ "outputs": [],
20
+ "source": [
21
+ "# ⚠️ Please make sure you have adequate GPU memory.\n",
22
+ "# ⚠️ Please make sure your EnergyPlus version is 9.6 for successful running.\n",
23
+ "\n",
24
+ "! pip install -U bitsandbytes -q # pip this repo at the first time."
25
+ ]
26
+ },
27
+ {
28
+ "cell_type": "code",
29
+ "execution_count": null,
30
+ "metadata": {
31
+ "colab": {
32
+ "base_uri": "https://localhost:8080/",
33
+ "height": 631,
34
+ "referenced_widgets": [
35
+ "e7585d867fa3458e9ebdc466b90ec50a",
36
+ "c0dd32a5465a411980afc081a14c8a94",
37
+ "12396fb59bfe4caba1afd4ebdd3c7166",
38
+ "31523936a58248c1ad48734679a19e1b",
39
+ "6bb7e87ec01540afa838fc3a32863086",
40
+ "af96d619c88e4ae09bd08608f4044fb1",
41
+ "ff7722b5607f427bafe1908968793aa3",
42
+ "2d0e7dcbb89c42cba38c517b846ea87d",
43
+ "1fc1604b618d45e6aac8cd96ff1538ad",
44
+ "98e0e5d89251416aad4e0c0aeee6388f",
45
+ "e5b6950cf9d844a69b92b45601992e48"
46
+ ]
47
+ },
48
+ "executionInfo": {
49
+ "elapsed": 185162,
50
+ "status": "error",
51
+ "timestamp": 1745784064933,
52
+ "user": {
53
+ "displayName": "Gang Jiang",
54
+ "userId": "14372238440999662262"
55
+ },
56
+ "user_tz": 360
57
+ },
58
+ "id": "wKnRwGpxujPF",
59
+ "outputId": "3929f469-ef41-41ee-c6e1-1581da43fd9e"
60
+ },
61
+ "outputs": [],
62
+ "source": [
63
+ "from transformers import AutoModelForSeq2SeqLM, AutoTokenizer\n",
64
+ "import torch\n",
65
+ "from peft import PeftModel, PeftConfig\n",
66
+ "import os\n",
67
+ "os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"\n",
68
+ "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
69
+ "\n",
70
+ "# Load the EPlus-LLMv2 config.\n",
71
+ "peft_model_id = \"EPlus-LLM/EPlus-LLMv2\"\n",
72
+ "config = PeftConfig.from_pretrained(peft_model_id)\n",
73
+ "\n",
74
+ "# Load the base LLM, flan-t5-xxl, and tokenizer\n",
75
+ "model = AutoModelForSeq2SeqLM.from_pretrained(\"google/flan-t5-xxl\", load_in_8bit=True)\n",
76
+ "tokenizer = AutoTokenizer.from_pretrained(\"google/flan-t5-xxl\")\n",
77
+ "\n",
78
+ "# Load the Lora model\n",
79
+ "model = PeftModel.from_pretrained(model, peft_model_id)\n",
80
+ "\n",
81
+ "# Generation config\n",
82
+ "generation_config = model.generation_config\n",
83
+ "generation_config.max_new_tokens = 5000\n",
84
+ "generation_config.temperature = 0.1\n",
85
+ "generation_config.top_p = 0.1\n",
86
+ "generation_config.num_return_sequences = 1\n",
87
+ "generation_config.pad_token_id = tokenizer.eos_token_id\n",
88
+ "generation_config.eos_token_id = tokenizer.eos_token_id\n",
89
+ "\n",
90
+ "# Please provide your input here — a description of the desired building\n",
91
+ "# For more details, please refer to the paper: https://doi.org/10.1016/j.autcon.2025.106223\n",
92
+ "input=f\"\"\"\n",
93
+ "Simulate a U-shaped building that is 99.73 meters high, with a gable roof. \n",
94
+ "The horizontal segment is 732.31 meters long and 17.54 meters wide. The left vertical segment is 256.31 meters long and 206.96 meters wide. The right vertical segment is 431.54 meters long and 62 meters wide. \n",
95
+ "The roof ridge is 8.77 meters to the length side of the horizontal segment, and 128.16 meters, 215.77 meters to the width side of the vertical segments, respectively. \n",
96
+ "The attic height is 139.71 meters. The building orientation is 62 degrees to the north. The building has 3 thermal zones with each segment as one thermal zone. \n",
97
+ "The window-to-wall ratio is 0.32. The window sill height is 33.91 meters, the window height is 65.82 meters, and the window jamb width is 0.01 meters. \n",
98
+ "The window U-factor is 6.36 W/m2K and the SHGC is 0.89. \n",
99
+ "The wall is made of wood, with a thickness of 0.48 meters and the wall insulation is RSI 1.6 m2K/W, U-factor 0.63 W/m2K. \n",
100
+ "The roof is made of metal, with a thickness of 0.09 meters and the roof insulation is RSI 5.4 m2K/W, U-factor 0.19 W/m2K. \n",
101
+ "The floor is made of concrete, covered with carpet. The ventilation rate is 2.32 ach. The infiltration rate is 0.55 ach. \n",
102
+ "The people density is 16.61 m2/person, the light density is 4.48 W/m2, and the electric equipment density is 22.63 W/m2. \n",
103
+ "Occupancy starts at 7:00 and ends at 18:00. The occupancy rate is 1. The unoccupancy rate is 0.3. \n",
104
+ "The heating setpoint is 21.54 Celsius in occupancy period and 15.86 Celsius in unoccupancy period. \n",
105
+ "The cooling setpoint is 22.6 Celsius in occupancy period and 26.72 Celsius in unoccupancy period.\n",
106
+ "\"\"\"\n",
107
+ "\n",
108
+ "# EPlus-LLM generating...\n",
109
+ "input_ids = tokenizer(input, return_tensors=\"pt\", truncation=False).to(device)\n",
110
+ "generated_ids = model.generate(input_ids = input_ids.input_ids,\n",
111
+ " attention_mask = input_ids.attention_mask,\n",
112
+ " generation_config = generation_config)\n",
113
+ "generated_output = tokenizer.decode(generated_ids[0], skip_special_tokens=True)\n",
114
+ "\n",
115
+ "# Default thermal zones setting \n",
116
+ "zone_1 = \"\"\"ZoneHVAC:EquipmentConnections,Thermal Zone 1,Thermal Zone 1 Equipment,Thermal Zone 1 Ideal Loads Supply Inlet,,Thermal Zone 1 Zone Air Node,Thermal Zone 1 Return Outlet;\n",
117
+ "ZoneHVAC:EquipmentList,Thermal Zone 1 Equipment,SequentialLoad,ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 1 Ideal Loads Air System,1,1,,;\n",
118
+ "ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 1 Ideal Loads Air System,,Thermal Zone 1 Ideal Loads Supply Inlet,,,50,13,0.0156,0.0077,NoLimit,,,NoLimit,,,,,ConstantSensibleHeatRatio,0.7,None,,,None,NoEconomizer,None,0.7,0.65;\n",
119
+ "ZoneControl:Thermostat,Thermal Zone 1 Thermostat,Thermal Zone 1,Thermostat Schedule,ThermostatSetpoint:DualSetpoint,Thermostat Setpoint Dual Setpoint,,,,,,,0;\n",
120
+ "Sizing:Zone,Thermal Zone 1,SupplyAirTemperature,14,11.11,SupplyAirTemperature,40,11.11,0.0085,0.008,Ventilation,,,DesignDay,0,0.000762,0,0,DesignDay,0,0.002032,0.1415762,0.3,,No;\"\"\"\n",
121
+ "zone_2 = \"\"\"ZoneHVAC:EquipmentConnections,Thermal Zone 2,Thermal Zone 2 Equipment,Thermal Zone 2 Ideal Loads Supply Inlet,,Thermal Zone 2 Zone Air Node,Thermal Zone 2 Return Outlet;\n",
122
+ "ZoneHVAC:EquipmentList,Thermal Zone 2 Equipment,SequentialLoad,ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 2 Ideal Loads Air System,1,1,,;\n",
123
+ "ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 2 Ideal Loads Air System,,Thermal Zone 2 Ideal Loads Supply Inlet,,,50,13,0.0156,0.0077,NoLimit,,,NoLimit,,,,,ConstantSensibleHeatRatio,0.7,None,,,None,NoEconomizer,None,0.7,0.65;\n",
124
+ "ZoneControl:Thermostat,Thermal Zone 2 Thermostat,Thermal Zone 2,Thermostat Schedule,ThermostatSetpoint:DualSetpoint,Thermostat Setpoint Dual Setpoint,,,,,,,0;\n",
125
+ "Sizing:Zone,Thermal Zone 2,SupplyAirTemperature,14,11.11,SupplyAirTemperature,40,11.11,0.0085,0.008,Ventilation,,,DesignDay,0,0.000762,0,0,DesignDay,0,0.002032,0.1415762,0.3,,No;\"\"\"\n",
126
+ "zone_3 = \"\"\"ZoneHVAC:EquipmentConnections,Thermal Zone 3,Thermal Zone 3 Equipment,Thermal Zone 3 Ideal Loads Supply Inlet,,Thermal Zone 3 Zone Air Node,Thermal Zone 3 Return Outlet;\n",
127
+ "ZoneHVAC:EquipmentList,Thermal Zone 3 Equipment,SequentialLoad,ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 3 Ideal Loads Air System,1,1,,;\n",
128
+ "ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 3 Ideal Loads Air System,,Thermal Zone 3 Ideal Loads Supply Inlet,,,50,13,0.0156,0.0077,NoLimit,,,NoLimit,,,,,ConstantSensibleHeatRatio,0.7,None,,,None,NoEconomizer,None,0.7,0.65;\n",
129
+ "ZoneControl:Thermostat,Thermal Zone 3 Thermostat,Thermal Zone 3,Thermostat Schedule,ThermostatSetpoint:DualSetpoint,Thermostat Setpoint Dual Setpoint,,,,,,,0;\n",
130
+ "Sizing:Zone,Thermal Zone 3,SupplyAirTemperature,14,11.11,SupplyAirTemperature,40,11.11,0.0085,0.008,Ventilation,,,DesignDay,0,0.000762,0,0,DesignDay,0,0.002032,0.1415762,0.3,,No;\"\"\"\n",
131
+ "zone_4 = \"\"\"ZoneHVAC:EquipmentConnections,Thermal Zone 4,Thermal Zone 4 Equipment,Thermal Zone 4 Ideal Loads Supply Inlet,,Thermal Zone 4 Zone Air Node,Thermal Zone 4 Return Outlet;\n",
132
+ "ZoneHVAC:EquipmentList,Thermal Zone 4 Equipment,SequentialLoad,ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 4 Ideal Loads Air System,1,1,,;\n",
133
+ "ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 4 Ideal Loads Air System,,Thermal Zone 4 Ideal Loads Supply Inlet,,,50,13,0.0156,0.0077,NoLimit,,,NoLimit,,,,,ConstantSensibleHeatRatio,0.7,None,,,None,NoEconomizer,None,0.7,0.65;\n",
134
+ "ZoneControl:Thermostat,Thermal Zone 4 Thermostat,Thermal Zone 4,Thermostat Schedule,ThermostatSetpoint:DualSetpoint,Thermostat Setpoint Dual Setpoint,,,,,,,0;\n",
135
+ "Sizing:Zone,Thermal Zone 4,SupplyAirTemperature,14,11.11,SupplyAirTemperature,40,11.11,0.0085,0.008,Ventilation,,,DesignDay,0,0.000762,0,0,DesignDay,0,0.002032,0.1415762,0.3,,No;\"\"\"\n",
136
+ "zone_5 = \"\"\"ZoneHVAC:EquipmentConnections,Thermal Zone 5,Thermal Zone 5 Equipment,Thermal Zone 5 Ideal Loads Supply Inlet,,Thermal Zone 5 Zone Air Node,Thermal Zone 5 Return Outlet;\n",
137
+ "ZoneHVAC:EquipmentList,Thermal Zone 5 Equipment,SequentialLoad,ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 5 Ideal Loads Air System,1,1,,;\n",
138
+ "ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 5 Ideal Loads Air System,,Thermal Zone 5 Ideal Loads Supply Inlet,,,50,13,0.0156,0.0077,NoLimit,,,NoLimit,,,,,ConstantSensibleHeatRatio,0.7,None,,,None,NoEconomizer,None,0.7,0.65;\n",
139
+ "ZoneControl:Thermostat,Thermal Zone 5 Thermostat,Thermal Zone 5,Thermostat Schedule,ThermostatSetpoint:DualSetpoint,Thermostat Setpoint Dual Setpoint,,,,,,,0;\n",
140
+ "Sizing:Zone,Thermal Zone 5,SupplyAirTemperature,14,11.11,SupplyAirTemperature,40,11.11,0.0085,0.008,Ventilation,,,DesignDay,0,0.000762,0,0,DesignDay,0,0.002032,0.1415762,0.3,,No;\"\"\"\n",
141
+ "generated_output = generated_output.replace(\"Ideal Load System Setting for Thermal Zone 1;\", zone_1)\n",
142
+ "generated_output = generated_output.replace(\"Ideal Load System Setting for Thermal Zone 2;\", zone_2)\n",
143
+ "generated_output = generated_output.replace(\"Ideal Load System Setting for Thermal Zone 3;\", zone_3)\n",
144
+ "generated_output = generated_output.replace(\"Ideal Load System Setting for Thermal Zone 4;\", zone_4)\n",
145
+ "generated_output = generated_output.replace(\"Ideal Load System Setting for Thermal Zone 5;\", zone_5)\n",
146
+ "\n",
147
+ "# Load the rest port of IDF file.\n",
148
+ "file_path = \"v2_nextpart.idf\"\n",
149
+ "output_path = \"v2_final.idf\"\n",
150
+ "# Output the building energy model in IDF file\n",
151
+ "with open(file_path, 'r', encoding='utf-8') as file:\n",
152
+ " nextpart = file.read()\n",
153
+ "final_text = nextpart + \"\\n\\n\" + generated_output\n",
154
+ "with open(output_path, 'w', encoding='utf-8') as f:\n",
155
+ " f.write(final_text)\n",
156
+ "print(f\"Building Energy Model Auto-Generated: {output_path}\")"
157
+ ]
158
+ }
159
+ ],
160
+ "metadata": {
161
+ "accelerator": "GPU",
162
+ "colab": {
163
+ "authorship_tag": "ABX9TyON1YYo2/wB54t5VKa5gcTl",
164
+ "gpuType": "T4",
165
+ "provenance": []
166
+ },
167
+ "kernelspec": {
168
+ "display_name": "Python 3",
169
+ "name": "python3"
170
+ },
171
+ "language_info": {
172
+ "name": "python"
173
+ },
174
+ "widgets": {
175
+ "application/vnd.jupyter.widget-state+json": {
176
+ "12396fb59bfe4caba1afd4ebdd3c7166": {
177
+ "model_module": "@jupyter-widgets/controls",
178
+ "model_module_version": "1.5.0",
179
+ "model_name": "FloatProgressModel",
180
+ "state": {
181
+ "_dom_classes": [],
182
+ "_model_module": "@jupyter-widgets/controls",
183
+ "_model_module_version": "1.5.0",
184
+ "_model_name": "FloatProgressModel",
185
+ "_view_count": null,
186
+ "_view_module": "@jupyter-widgets/controls",
187
+ "_view_module_version": "1.5.0",
188
+ "_view_name": "ProgressView",
189
+ "bar_style": "danger",
190
+ "description": "",
191
+ "description_tooltip": null,
192
+ "layout": "IPY_MODEL_2d0e7dcbb89c42cba38c517b846ea87d",
193
+ "max": 5,
194
+ "min": 0,
195
+ "orientation": "horizontal",
196
+ "style": "IPY_MODEL_1fc1604b618d45e6aac8cd96ff1538ad",
197
+ "value": 4
198
+ }
199
+ },
200
+ "1fc1604b618d45e6aac8cd96ff1538ad": {
201
+ "model_module": "@jupyter-widgets/controls",
202
+ "model_module_version": "1.5.0",
203
+ "model_name": "ProgressStyleModel",
204
+ "state": {
205
+ "_model_module": "@jupyter-widgets/controls",
206
+ "_model_module_version": "1.5.0",
207
+ "_model_name": "ProgressStyleModel",
208
+ "_view_count": null,
209
+ "_view_module": "@jupyter-widgets/base",
210
+ "_view_module_version": "1.2.0",
211
+ "_view_name": "StyleView",
212
+ "bar_color": null,
213
+ "description_width": ""
214
+ }
215
+ },
216
+ "2d0e7dcbb89c42cba38c517b846ea87d": {
217
+ "model_module": "@jupyter-widgets/base",
218
+ "model_module_version": "1.2.0",
219
+ "model_name": "LayoutModel",
220
+ "state": {
221
+ "_model_module": "@jupyter-widgets/base",
222
+ "_model_module_version": "1.2.0",
223
+ "_model_name": "LayoutModel",
224
+ "_view_count": null,
225
+ "_view_module": "@jupyter-widgets/base",
226
+ "_view_module_version": "1.2.0",
227
+ "_view_name": "LayoutView",
228
+ "align_content": null,
229
+ "align_items": null,
230
+ "align_self": null,
231
+ "border": null,
232
+ "bottom": null,
233
+ "display": null,
234
+ "flex": null,
235
+ "flex_flow": null,
236
+ "grid_area": null,
237
+ "grid_auto_columns": null,
238
+ "grid_auto_flow": null,
239
+ "grid_auto_rows": null,
240
+ "grid_column": null,
241
+ "grid_gap": null,
242
+ "grid_row": null,
243
+ "grid_template_areas": null,
244
+ "grid_template_columns": null,
245
+ "grid_template_rows": null,
246
+ "height": null,
247
+ "justify_content": null,
248
+ "justify_items": null,
249
+ "left": null,
250
+ "margin": null,
251
+ "max_height": null,
252
+ "max_width": null,
253
+ "min_height": null,
254
+ "min_width": null,
255
+ "object_fit": null,
256
+ "object_position": null,
257
+ "order": null,
258
+ "overflow": null,
259
+ "overflow_x": null,
260
+ "overflow_y": null,
261
+ "padding": null,
262
+ "right": null,
263
+ "top": null,
264
+ "visibility": null,
265
+ "width": null
266
+ }
267
+ },
268
+ "31523936a58248c1ad48734679a19e1b": {
269
+ "model_module": "@jupyter-widgets/controls",
270
+ "model_module_version": "1.5.0",
271
+ "model_name": "HTMLModel",
272
+ "state": {
273
+ "_dom_classes": [],
274
+ "_model_module": "@jupyter-widgets/controls",
275
+ "_model_module_version": "1.5.0",
276
+ "_model_name": "HTMLModel",
277
+ "_view_count": null,
278
+ "_view_module": "@jupyter-widgets/controls",
279
+ "_view_module_version": "1.5.0",
280
+ "_view_name": "HTMLView",
281
+ "description": "",
282
+ "description_tooltip": null,
283
+ "layout": "IPY_MODEL_98e0e5d89251416aad4e0c0aeee6388f",
284
+ "placeholder": "​",
285
+ "style": "IPY_MODEL_e5b6950cf9d844a69b92b45601992e48",
286
+ "value": " 4/5 [02:45<00:41, 41.60s/it]"
287
+ }
288
+ },
289
+ "6bb7e87ec01540afa838fc3a32863086": {
290
+ "model_module": "@jupyter-widgets/base",
291
+ "model_module_version": "1.2.0",
292
+ "model_name": "LayoutModel",
293
+ "state": {
294
+ "_model_module": "@jupyter-widgets/base",
295
+ "_model_module_version": "1.2.0",
296
+ "_model_name": "LayoutModel",
297
+ "_view_count": null,
298
+ "_view_module": "@jupyter-widgets/base",
299
+ "_view_module_version": "1.2.0",
300
+ "_view_name": "LayoutView",
301
+ "align_content": null,
302
+ "align_items": null,
303
+ "align_self": null,
304
+ "border": null,
305
+ "bottom": null,
306
+ "display": null,
307
+ "flex": null,
308
+ "flex_flow": null,
309
+ "grid_area": null,
310
+ "grid_auto_columns": null,
311
+ "grid_auto_flow": null,
312
+ "grid_auto_rows": null,
313
+ "grid_column": null,
314
+ "grid_gap": null,
315
+ "grid_row": null,
316
+ "grid_template_areas": null,
317
+ "grid_template_columns": null,
318
+ "grid_template_rows": null,
319
+ "height": null,
320
+ "justify_content": null,
321
+ "justify_items": null,
322
+ "left": null,
323
+ "margin": null,
324
+ "max_height": null,
325
+ "max_width": null,
326
+ "min_height": null,
327
+ "min_width": null,
328
+ "object_fit": null,
329
+ "object_position": null,
330
+ "order": null,
331
+ "overflow": null,
332
+ "overflow_x": null,
333
+ "overflow_y": null,
334
+ "padding": null,
335
+ "right": null,
336
+ "top": null,
337
+ "visibility": null,
338
+ "width": null
339
+ }
340
+ },
341
+ "98e0e5d89251416aad4e0c0aeee6388f": {
342
+ "model_module": "@jupyter-widgets/base",
343
+ "model_module_version": "1.2.0",
344
+ "model_name": "LayoutModel",
345
+ "state": {
346
+ "_model_module": "@jupyter-widgets/base",
347
+ "_model_module_version": "1.2.0",
348
+ "_model_name": "LayoutModel",
349
+ "_view_count": null,
350
+ "_view_module": "@jupyter-widgets/base",
351
+ "_view_module_version": "1.2.0",
352
+ "_view_name": "LayoutView",
353
+ "align_content": null,
354
+ "align_items": null,
355
+ "align_self": null,
356
+ "border": null,
357
+ "bottom": null,
358
+ "display": null,
359
+ "flex": null,
360
+ "flex_flow": null,
361
+ "grid_area": null,
362
+ "grid_auto_columns": null,
363
+ "grid_auto_flow": null,
364
+ "grid_auto_rows": null,
365
+ "grid_column": null,
366
+ "grid_gap": null,
367
+ "grid_row": null,
368
+ "grid_template_areas": null,
369
+ "grid_template_columns": null,
370
+ "grid_template_rows": null,
371
+ "height": null,
372
+ "justify_content": null,
373
+ "justify_items": null,
374
+ "left": null,
375
+ "margin": null,
376
+ "max_height": null,
377
+ "max_width": null,
378
+ "min_height": null,
379
+ "min_width": null,
380
+ "object_fit": null,
381
+ "object_position": null,
382
+ "order": null,
383
+ "overflow": null,
384
+ "overflow_x": null,
385
+ "overflow_y": null,
386
+ "padding": null,
387
+ "right": null,
388
+ "top": null,
389
+ "visibility": null,
390
+ "width": null
391
+ }
392
+ },
393
+ "af96d619c88e4ae09bd08608f4044fb1": {
394
+ "model_module": "@jupyter-widgets/base",
395
+ "model_module_version": "1.2.0",
396
+ "model_name": "LayoutModel",
397
+ "state": {
398
+ "_model_module": "@jupyter-widgets/base",
399
+ "_model_module_version": "1.2.0",
400
+ "_model_name": "LayoutModel",
401
+ "_view_count": null,
402
+ "_view_module": "@jupyter-widgets/base",
403
+ "_view_module_version": "1.2.0",
404
+ "_view_name": "LayoutView",
405
+ "align_content": null,
406
+ "align_items": null,
407
+ "align_self": null,
408
+ "border": null,
409
+ "bottom": null,
410
+ "display": null,
411
+ "flex": null,
412
+ "flex_flow": null,
413
+ "grid_area": null,
414
+ "grid_auto_columns": null,
415
+ "grid_auto_flow": null,
416
+ "grid_auto_rows": null,
417
+ "grid_column": null,
418
+ "grid_gap": null,
419
+ "grid_row": null,
420
+ "grid_template_areas": null,
421
+ "grid_template_columns": null,
422
+ "grid_template_rows": null,
423
+ "height": null,
424
+ "justify_content": null,
425
+ "justify_items": null,
426
+ "left": null,
427
+ "margin": null,
428
+ "max_height": null,
429
+ "max_width": null,
430
+ "min_height": null,
431
+ "min_width": null,
432
+ "object_fit": null,
433
+ "object_position": null,
434
+ "order": null,
435
+ "overflow": null,
436
+ "overflow_x": null,
437
+ "overflow_y": null,
438
+ "padding": null,
439
+ "right": null,
440
+ "top": null,
441
+ "visibility": null,
442
+ "width": null
443
+ }
444
+ },
445
+ "c0dd32a5465a411980afc081a14c8a94": {
446
+ "model_module": "@jupyter-widgets/controls",
447
+ "model_module_version": "1.5.0",
448
+ "model_name": "HTMLModel",
449
+ "state": {
450
+ "_dom_classes": [],
451
+ "_model_module": "@jupyter-widgets/controls",
452
+ "_model_module_version": "1.5.0",
453
+ "_model_name": "HTMLModel",
454
+ "_view_count": null,
455
+ "_view_module": "@jupyter-widgets/controls",
456
+ "_view_module_version": "1.5.0",
457
+ "_view_name": "HTMLView",
458
+ "description": "",
459
+ "description_tooltip": null,
460
+ "layout": "IPY_MODEL_af96d619c88e4ae09bd08608f4044fb1",
461
+ "placeholder": "​",
462
+ "style": "IPY_MODEL_ff7722b5607f427bafe1908968793aa3",
463
+ "value": "Loading checkpoint��shards:  80%"
464
+ }
465
+ },
466
+ "e5b6950cf9d844a69b92b45601992e48": {
467
+ "model_module": "@jupyter-widgets/controls",
468
+ "model_module_version": "1.5.0",
469
+ "model_name": "DescriptionStyleModel",
470
+ "state": {
471
+ "_model_module": "@jupyter-widgets/controls",
472
+ "_model_module_version": "1.5.0",
473
+ "_model_name": "DescriptionStyleModel",
474
+ "_view_count": null,
475
+ "_view_module": "@jupyter-widgets/base",
476
+ "_view_module_version": "1.2.0",
477
+ "_view_name": "StyleView",
478
+ "description_width": ""
479
+ }
480
+ },
481
+ "e7585d867fa3458e9ebdc466b90ec50a": {
482
+ "model_module": "@jupyter-widgets/controls",
483
+ "model_module_version": "1.5.0",
484
+ "model_name": "HBoxModel",
485
+ "state": {
486
+ "_dom_classes": [],
487
+ "_model_module": "@jupyter-widgets/controls",
488
+ "_model_module_version": "1.5.0",
489
+ "_model_name": "HBoxModel",
490
+ "_view_count": null,
491
+ "_view_module": "@jupyter-widgets/controls",
492
+ "_view_module_version": "1.5.0",
493
+ "_view_name": "HBoxView",
494
+ "box_style": "",
495
+ "children": [
496
+ "IPY_MODEL_c0dd32a5465a411980afc081a14c8a94",
497
+ "IPY_MODEL_12396fb59bfe4caba1afd4ebdd3c7166",
498
+ "IPY_MODEL_31523936a58248c1ad48734679a19e1b"
499
+ ],
500
+ "layout": "IPY_MODEL_6bb7e87ec01540afa838fc3a32863086"
501
+ }
502
+ },
503
+ "ff7722b5607f427bafe1908968793aa3": {
504
+ "model_module": "@jupyter-widgets/controls",
505
+ "model_module_version": "1.5.0",
506
+ "model_name": "DescriptionStyleModel",
507
+ "state": {
508
+ "_model_module": "@jupyter-widgets/controls",
509
+ "_model_module_version": "1.5.0",
510
+ "_model_name": "DescriptionStyleModel",
511
+ "_view_count": null,
512
+ "_view_module": "@jupyter-widgets/base",
513
+ "_view_module_version": "1.2.0",
514
+ "_view_name": "StyleView",
515
+ "description_width": ""
516
+ }
517
+ }
518
+ }
519
+ }
520
+ },
521
+ "nbformat": 4,
522
+ "nbformat_minor": 0
523
+ }
README.md CHANGED
@@ -1,3 +1,257 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: cc-by-nc-4.0
5
+ base_model:
6
+ - google/flan-t5-large
7
+ ---
8
+ # EPlus-LLM
9
+
10
+ <!-- Logo 居中显示 -->
11
+ <div align="center">
12
+ <img src="https://huggingface.co/EPlus-LLM/EPlus-LLMv2/resolve/main/figs/v2_platform_logo.png?raw=true" width="100%" alt="EPlus-LLM v2" />
13
+ </div>
14
+
15
+ <hr>
16
+
17
+ <!-- Badge 样式美化 + 自适应布局 -->
18
+ <style>
19
+ .badge-container {
20
+ display: flex;
21
+ flex-wrap: wrap;
22
+ justify-content: center;
23
+ align-items: center;
24
+ gap: 6px;
25
+ margin-top: 10px;
26
+ margin-bottom: 10px;
27
+ }
28
+ .badge-container a img {
29
+ height: 28px;
30
+ transition: transform 0.2s ease;
31
+ }
32
+ .badge-container a:hover img {
33
+ transform: scale(1.05);
34
+ }
35
+ @media (max-width: 500px) {
36
+ .badge-container a img {
37
+ height: 24px;
38
+ }
39
+ }
40
+ </style>
41
+
42
+ <!-- 徽章容器 -->
43
+ <div class="badge-container">
44
+ <a href="https://huggingface.co/EPlus-LLM" target="_blank">
45
+ <img alt="Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-EPlus--LLM-ffc107?color=ffc107&logoColor=white"/>
46
+ </a>
47
+ <a href="https://colab.research.google.com/github/Gangjiang1/EPlus-LLM/blob/main/v2/EPlus-LLMv2_inference.ipynb" target="_blank">
48
+ <img alt="Open In Colab" src="https://colab.research.google.com/assets/colab-badge.svg"/>
49
+ </a>
50
+ <a href="https://www.linkedin.com/in/gang-jiang-46b990273" target="_blank" style="margin: 2px;">
51
+ <img alt="LinkedIn" src="https://img.shields.io/badge/🤖LinkedIn-Connect-0A66C2?style=flat&logo=linkedin&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
52
+ </a>
53
+ <a href="https://www.sciencedirect.com/science/article/pii/S0926580525002638" target="_blank">
54
+ <img alt="Paper" src="https://img.shields.io/badge/Paper-EPlus--LLM%20V2-red?logo=arxiv&logoColor=white"/>
55
+ </a>
56
+ <a href="https://huggingface.co/EPlus-LLM/EPlus-LLMv2/resolve/main/figs/qr.png?raw=true" target="_blank">
57
+ <img alt="WeChat" src="https://img.shields.io/badge/WeChat-Gang%20Jiang-brightgreen?logo=wechat&logoColor=white"/>
58
+ </a>
59
+ <a href="LICENSE" target="_blank">
60
+ <img alt="License" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?logo=apache&logoColor=f5de53" style="display: inline-block; vertical-align: middle;"/>
61
+ </a>
62
+ </div>
63
+
64
+ **EPlus-LLM series, natural language for auto-building energy modeling via LLM**
65
+
66
+ <div align="center">
67
+ <img src="https://huggingface.co/EPlus-LLM/EPlus-LLMv2/resolve/main/figs/graphic.png" alt="Illustration of EPlus-LLMv2 for Auto-building energy modeling" width="700"/>
68
+ </div>
69
+
70
+
71
+ ## 🎉 News
72
+ - ⚠️ [2025/05/15] (update #5): A bug has been fixed and the model has been updated. Many thanks to the user for the feedback! Appreciated!!
73
+ - 📄 [2025/04/18] (update #4): The paper related to the EPlus-LLMv2 platform has been accepted for publication in _Automation in Construction_.
74
+ [Paper here](https://doi.org/10.1016/j.autcon.2025.106223).
75
+ - ⚡️ [2025/01/15] (update #3): We release EPlus-LLMv2, successfully addressing the challenge of auto-building energy modeling (ABEM) in complex scenarios. The new version of the platform supports a wide range of modeling scenarios encountered in real-world building applications, significantly enhancing its breadth and flexibility. Based on comprehensive datasets and a large-scale LLM, we integrate techniques such as LoRA, mixed precision training, and model quantification to reduce computational burden and achieve efficient fine-tuning (without compensating performance).
76
+ [Paper coming soon](https://doi.org/10.1016/j.apenergy.2024.123431).
77
+ - 📄 [2025/01/14] (update #2): Our paper on using prompt engineering to inform LLMs for automated building energy modeling has been accepted by _Energy_.
78
+ [Paper here](https://doi.org/10.1016/j.energy.2025.134548).
79
+ - 🔥 [2024/05/016] (update #1): We first successfully implement natural language-based auto-building modeling by fine-tuning a large language model (LLM).
80
+ [Paper here](https://doi.org/10.1016/j.apenergy.2024.123431).
81
+
82
+ ## 🚀 Key Features
83
+ - Scalability: Auto-generates complex EnergyPlus models, including varying geometries, materials, thermal zones, hourly schedules, and more.
84
+ - Accuracy & Efficiency: Achieves 100% modeling accuracy while reducing manual modeling time by over 98%.
85
+ - Interaction & Automation: A user-friendly human-AI interface for seamless model creation and customization.
86
+
87
+ <div align="center">
88
+ <img src="https://huggingface.co/EPlus-LLM/EPlus-LLMv2/resolve/main/figs/v2_paltform.png" alt="Description" width="600"/>
89
+ <p><em>A user-friendly human-AI interface for EPlus-LLMv2.</em></p>
90
+ </div>
91
+
92
+ - Flexible Design Scenarios:
93
+
94
+ ✅ Geometry: square, L-, T-, U-, and hollow-square-shaped buildings
95
+ ✅ Roof types: flat, gable, hip – customizable attic/ridge height
96
+ ✅ Orientation & windows: custom WWR, window placement, facade-specific controls
97
+ ✅ Walls & materials: thermal properties, insulation types
98
+ ✅ Internal loads: lighting, equipment, occupancy, infiltration/ventilation, schedules, heating/cooling setpoints
99
+ ✅ Thermal zoning: configurable multi-zone layouts with core & perimeter zones
100
+
101
+ <div align="center">
102
+ <img src="https://huggingface.co/EPlus-LLM/EPlus-LLMv2/resolve/main/figs/v2_prompt-model.png" alt="Prompt-Model Description" width="600"/>
103
+ <p><em>The relationship between the prompt and the model.</em></p>
104
+ </div>
105
+
106
+ ## 🏗️ Target Users
107
+ This current platform is designed for engineers, architects, and researchers working in building performance, sustainability, and resilience. It is especially useful during early-stage conceptual design when modeling decisions have the greatest impact.
108
+ <div align="center">
109
+ <img src="https://huggingface.co/EPlus-LLM/EPlus-LLMv2/resolve/main/figs/v2_example1.png" alt="Examples of EPlus-LLMv2" width="600"/>
110
+ <p><em>EXample scenarios of EPlus-LLMv2.</em></p>
111
+ </div>
112
+
113
+ ## 🚀 Quick Start
114
+
115
+ Here provides a code snippet to show you how to load the EPlus-LLM and auto-generate building energy models.
116
+
117
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Gangjiang1/EPlus-LLM/blob/main/v2/EPlus-LLMv2_inference.ipynb)
118
+
119
+ ```python
120
+ # ⚠️ Please make sure you have adequate GPU memory.
121
+ # ⚠️ Please make sure your EnergyPlus version is 9.6 for successful running.
122
+ # ⚠️ Download the v2_nextpart.idf file from the EPlus-LLMv2 repo and place it in your current working directory.
123
+
124
+ # ! pip install -U bitsandbytes -q # pip this repo at your first run
125
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
126
+ import torch
127
+ from peft import PeftModel, PeftConfig
128
+
129
+ # Load the EPlus-LLMv2 config.
130
+ peft_model_id = "EPlus-LLM/EPlus-LLMv2"
131
+ config = PeftConfig.from_pretrained(peft_model_id)
132
+
133
+ # Load the base LLM, flan-t5-xxl, and tokenizer
134
+ model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-xxl", load_in_8bit=True)
135
+ tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-xxl")
136
+
137
+ # Load the Lora model
138
+ model = PeftModel.from_pretrained(model, peft_model_id)
139
+
140
+ # Generation config
141
+ generation_config = model.generation_config
142
+ generation_config.max_new_tokens = 5000
143
+ generation_config.temperature = 0.1
144
+ generation_config.top_p = 0.1
145
+ generation_config.num_return_sequences = 1
146
+ generation_config.pad_token_id = tokenizer.eos_token_id
147
+ generation_config.eos_token_id = tokenizer.eos_token_id
148
+
149
+ # Please provide your input here — a description of the desired building
150
+ # For more details, please refer to the paper: https://doi.org/10.1016/j.autcon.2025.106223
151
+ input=f"""
152
+ Simulate a U-shaped building that is 99.73 meters high, with a gable roof.
153
+ The horizontal segment is 732.31 meters long and 17.54 meters wide.
154
+ The left vertical segment is 256.31 meters long and 206.96 meters wide.
155
+ The right vertical segment is 431.54 meters long and 62 meters wide.
156
+ The roof ridge is 8.77 meters to the length side of the horizontal segment, and 128.16 meters, 215.77 meters to the width side of the vertical segments, respectively.
157
+ The attic height is 139.71 meters. The building orientation is 62 degrees to the north.
158
+ The building has 3 thermal zones with each segment as one thermal zone.
159
+ The window-to-wall ratio is 0.32. The window sill height is 33.91 meters, the window height is 65.82 meters, and the window jamb width is 0.01 meters.
160
+ The window U-factor is 6.36 W/m2K and the SHGC is 0.89.
161
+ The wall is made of wood, with a thickness of 0.48 meters and the wall insulation is RSI 1.6 m2K/W, U-factor 0.63 W/m2K.
162
+ The roof is made of metal, with a thickness of 0.09 meters and the roof insulation is RSI 5.4 m2K/W, U-factor 0.19 W/m2K.
163
+ The floor is made of concrete, covered with carpet. The ventilation rate is 2.32 ach. The infiltration rate is 0.55 ach.
164
+ The people density is 16.61 m2/person, the light density is 4.48 W/m2, and the electric equipment density is 22.63 W/m2.
165
+ Occupancy starts at 7:00 and ends at 18:00. The occupancy rate is 1. The unoccupancy rate is 0.3.
166
+ The heating setpoint is 21.54 Celsius in occupancy period and 15.86 Celsius in unoccupancy period.
167
+ The cooling setpoint is 22.6 Celsius in occupancy period and 26.72 Celsius in unoccupancy period.
168
+ """
169
+
170
+ # EPlus-LLM generating...
171
+ input_ids = tokenizer(input, return_tensors="pt", truncation=False)
172
+ generated_ids = model.generate(input_ids = input_ids.input_ids,
173
+ attention_mask = input_ids.attention_mask,
174
+ generation_config = generation_config)
175
+ generated_output = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
176
+
177
+ # Default thermal zones setting
178
+ zone_1 = """ZoneHVAC:EquipmentConnections,Thermal Zone 1,Thermal Zone 1 Equipment,Thermal Zone 1 Ideal Loads Supply Inlet,,Thermal Zone 1 Zone Air Node,Thermal Zone 1 Return Outlet;
179
+ ZoneHVAC:EquipmentList,Thermal Zone 1 Equipment,SequentialLoad,ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 1 Ideal Loads Air System,1,1,,;
180
+ ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 1 Ideal Loads Air System,,Thermal Zone 1 Ideal Loads Supply Inlet,,,50,13,0.0156,0.0077,NoLimit,,,NoLimit,,,,,ConstantSensibleHeatRatio,0.7,None,,,None,NoEconomizer,None,0.7,0.65;
181
+ ZoneControl:Thermostat,Thermal Zone 1 Thermostat,Thermal Zone 1,Thermostat Schedule,ThermostatSetpoint:DualSetpoint,Thermostat Setpoint Dual Setpoint,,,,,,,0;
182
+ Sizing:Zone,Thermal Zone 1,SupplyAirTemperature,14,11.11,SupplyAirTemperature,40,11.11,0.0085,0.008,Ventilation,,,DesignDay,0,0.000762,0,0,DesignDay,0,0.002032,0.1415762,0.3,,No;"""
183
+ zone_2 = """ZoneHVAC:EquipmentConnections,Thermal Zone 2,Thermal Zone 2 Equipment,Thermal Zone 2 Ideal Loads Supply Inlet,,Thermal Zone 2 Zone Air Node,Thermal Zone 2 Return Outlet;
184
+ ZoneHVAC:EquipmentList,Thermal Zone 2 Equipment,SequentialLoad,ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 2 Ideal Loads Air System,1,1,,;
185
+ ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 2 Ideal Loads Air System,,Thermal Zone 2 Ideal Loads Supply Inlet,,,50,13,0.0156,0.0077,NoLimit,,,NoLimit,,,,,ConstantSensibleHeatRatio,0.7,None,,,None,NoEconomizer,None,0.7,0.65;
186
+ ZoneControl:Thermostat,Thermal Zone 2 Thermostat,Thermal Zone 2,Thermostat Schedule,ThermostatSetpoint:DualSetpoint,Thermostat Setpoint Dual Setpoint,,,,,,,0;
187
+ Sizing:Zone,Thermal Zone 2,SupplyAirTemperature,14,11.11,SupplyAirTemperature,40,11.11,0.0085,0.008,Ventilation,,,DesignDay,0,0.000762,0,0,DesignDay,0,0.002032,0.1415762,0.3,,No;"""
188
+ zone_3 = """ZoneHVAC:EquipmentConnections,Thermal Zone 3,Thermal Zone 3 Equipment,Thermal Zone 3 Ideal Loads Supply Inlet,,Thermal Zone 3 Zone Air Node,Thermal Zone 3 Return Outlet;
189
+ ZoneHVAC:EquipmentList,Thermal Zone 3 Equipment,SequentialLoad,ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 3 Ideal Loads Air System,1,1,,;
190
+ ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 3 Ideal Loads Air System,,Thermal Zone 3 Ideal Loads Supply Inlet,,,50,13,0.0156,0.0077,NoLimit,,,NoLimit,,,,,ConstantSensibleHeatRatio,0.7,None,,,None,NoEconomizer,None,0.7,0.65;
191
+ ZoneControl:Thermostat,Thermal Zone 3 Thermostat,Thermal Zone 3,Thermostat Schedule,ThermostatSetpoint:DualSetpoint,Thermostat Setpoint Dual Setpoint,,,,,,,0;
192
+ Sizing:Zone,Thermal Zone 3,SupplyAirTemperature,14,11.11,SupplyAirTemperature,40,11.11,0.0085,0.008,Ventilation,,,DesignDay,0,0.000762,0,0,DesignDay,0,0.002032,0.1415762,0.3,,No;"""
193
+ zone_4 = """ZoneHVAC:EquipmentConnections,Thermal Zone 4,Thermal Zone 4 Equipment,Thermal Zone 4 Ideal Loads Supply Inlet,,Thermal Zone 4 Zone Air Node,Thermal Zone 4 Return Outlet;
194
+ ZoneHVAC:EquipmentList,Thermal Zone 4 Equipment,SequentialLoad,ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 4 Ideal Loads Air System,1,1,,;
195
+ ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 4 Ideal Loads Air System,,Thermal Zone 4 Ideal Loads Supply Inlet,,,50,13,0.0156,0.0077,NoLimit,,,NoLimit,,,,,ConstantSensibleHeatRatio,0.7,None,,,None,NoEconomizer,None,0.7,0.65;
196
+ ZoneControl:Thermostat,Thermal Zone 4 Thermostat,Thermal Zone 4,Thermostat Schedule,ThermostatSetpoint:DualSetpoint,Thermostat Setpoint Dual Setpoint,,,,,,,0;
197
+ Sizing:Zone,Thermal Zone 4,SupplyAirTemperature,14,11.11,SupplyAirTemperature,40,11.11,0.0085,0.008,Ventilation,,,DesignDay,0,0.000762,0,0,DesignDay,0,0.002032,0.1415762,0.3,,No;"""
198
+ zone_5 = """ZoneHVAC:EquipmentConnections,Thermal Zone 5,Thermal Zone 5 Equipment,Thermal Zone 5 Ideal Loads Supply Inlet,,Thermal Zone 5 Zone Air Node,Thermal Zone 5 Return Outlet;
199
+ ZoneHVAC:EquipmentList,Thermal Zone 5 Equipment,SequentialLoad,ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 5 Ideal Loads Air System,1,1,,;
200
+ ZoneHVAC:IdealLoadsAirSystem,Thermal Zone 5 Ideal Loads Air System,,Thermal Zone 5 Ideal Loads Supply Inlet,,,50,13,0.0156,0.0077,NoLimit,,,NoLimit,,,,,ConstantSensibleHeatRatio,0.7,None,,,None,NoEconomizer,None,0.7,0.65;
201
+ ZoneControl:Thermostat,Thermal Zone 5 Thermostat,Thermal Zone 5,Thermostat Schedule,ThermostatSetpoint:DualSetpoint,Thermostat Setpoint Dual Setpoint,,,,,,,0;
202
+ Sizing:Zone,Thermal Zone 5,SupplyAirTemperature,14,11.11,SupplyAirTemperature,40,11.11,0.0085,0.008,Ventilation,,,DesignDay,0,0.000762,0,0,DesignDay,0,0.002032,0.1415762,0.3,,No;"""
203
+ generated_output = generated_output.replace(";",";\n")
204
+ generated_output = generated_output.replace("Ideal Load System Setting for Thermal Zone 1;", zone_1)
205
+ generated_output = generated_output.replace("Ideal Load System Setting for Thermal Zone 2;", zone_2)
206
+ generated_output = generated_output.replace("Ideal Load System Setting for Thermal Zone 3;", zone_3)
207
+ generated_output = generated_output.replace("Ideal Load System Setting for Thermal Zone 4;", zone_4)
208
+ generated_output = generated_output.replace("Ideal Load System Setting for Thermal Zone 5;", zone_5)
209
+
210
+ # Load the rest port of IDF file.
211
+ file_path = "v2_nextpart.idf" # File is in the repo. Please download.
212
+ output_path = "v2_final.idf"
213
+
214
+ # Output the building energy model in IDF file
215
+ with open(file_path, 'r', encoding='utf-8') as file:
216
+ nextpart = file.read()
217
+ final_text = nextpart + "\n\n" + generated_output
218
+ with open(output_path, 'w', encoding='utf-8') as f:
219
+ f.write(final_text)
220
+ print(f"Building Energy Model Auto-Generated: {output_path}")
221
+ ```
222
+
223
+ ## 📝 Citation
224
+
225
+ If you find our work helpful, feel free to give us a cite.
226
+
227
+ ```
228
+ @article{jiang2025EPlus-LLMv2,
229
+ author = {Gang Jiang and Jianli Chen},
230
+ title = {Efficient fine-tuning of large language models for automated building energy modeling in complex cases},
231
+ journal = {Automation in Construction},
232
+ volume = {175},
233
+ pages = {106223},
234
+ year = {2025},
235
+ month = {July},
236
+ doi = {https://doi.org/10.1016/j.autcon.2025.106223}}
237
+
238
+ @article{jiang2025prompting,
239
+ author = {Gang Jiang and Zhihao Ma and Liang Zhang and Jianli Chen},
240
+ title = {Prompt engineering to inform large language models in automated building energy modeling},
241
+ journal = {Energy},
242
+ volume = {316},
243
+ pages = {134548},
244
+ year = {2025},
245
+ month = {Feb},
246
+ doi = {https://doi.org/10.1016/j.energy.2025.134548}}
247
+
248
+ @article{jiang2025EPlus-LLM,
249
+ author = {Gang Jiang and Zhihao Ma and Liang Zhang and Jianli Chen},
250
+ title = {EPlus-LLM: A large language model-based computing platform for automated building energy modeling},
251
+ journal = {Applied Energy},
252
+ volume = {367},
253
+ pages = {123431},
254
+ year = {2024},
255
+ month = {Aug},
256
+ doi = {https://doi.org/10.1016/j.apenergy.2024.123431}}
257
+ ```