Update README.md
Browse files
README.md
CHANGED
|
@@ -1,10 +1,85 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
datasets:
|
| 4 |
-
- bengsoon/volve_alpaca
|
| 5 |
-
language:
|
| 6 |
-
- en
|
| 7 |
-
base_model:
|
| 8 |
-
-
|
| 9 |
-
pipeline_tag: summarization
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- bengsoon/volve_alpaca
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
base_model:
|
| 8 |
+
- Meta/Meta-Llama-3-8B
|
| 9 |
+
pipeline_tag: summarization
|
| 10 |
+
tags:
|
| 11 |
+
- oil-and-gas
|
| 12 |
+
- energy
|
| 13 |
+
- drilling
|
| 14 |
+
---
|
| 15 |
+
# DriLLM Summarizer
|
| 16 |
+
|
| 17 |
+
## Background
|
| 18 |
+
This is a fine-tuned model from [Meta/Meta-Llama-3-8B](https://huggingface.co/Meta/Meta-Llama-3-8B). The model was finetuned using [Volve DDR dataset](https://huggingface.co/datasets/bengsoon/volve_alpaca) using the Alpaca template, using [Axolotl](https://github.com/axolotl-ai-cloud/axolotl).
|
| 19 |
+
|
| 20 |
+
The motivation behind this model was to fine-tune an LLM that is capable of understanding the nuances of the Drilling Operations and provide summarizations based on the inputs from Daily Drilling Reports hourly activites.
|
| 21 |
+
|
| 22 |
+
## How to use
|
| 23 |
+
### Recommended template for DriLLM summarization:
|
| 24 |
+
``` python
|
| 25 |
+
TEMPLATE = """<|begin_of_text|>Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
| 26 |
+
|
| 27 |
+
### Instruction:
|
| 28 |
+
{instruction}
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
### Input:
|
| 32 |
+
{input}
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
### Response:
|
| 36 |
+
|
| 37 |
+
"""
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
### Inferencing using Transformers Pipeline
|
| 41 |
+
``` python
|
| 42 |
+
import transformers
|
| 43 |
+
import torch
|
| 44 |
+
|
| 45 |
+
model_id = "bengsoon/DriLLM-Summarizer"
|
| 46 |
+
|
| 47 |
+
pipeline = transformers.pipeline(
|
| 48 |
+
"text-generation", model=model_id, model_kwargs={"torch_dtype": torch.bfloat16}, device_map="auto"
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
TEMPLATE = """<|begin_of_text|>Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
| 52 |
+
|
| 53 |
+
### Instruction:
|
| 54 |
+
{instruction}
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
### Input:
|
| 58 |
+
{input}
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
### Response:
|
| 62 |
+
|
| 63 |
+
"""
|
| 64 |
+
|
| 65 |
+
INSTRUCTION = """You are a Rig Supervisor working at an oil and gas offshore drilling operation. \
|
| 66 |
+
Your company is currently on a drilling campaign and you are the on-site Drilling Engineer (DE). \
|
| 67 |
+
As a DE, one of your jobs is to oversee the operations at the drilling rigs. As such, you know the ins and outs of the operation, down to the hourly activities. \
|
| 68 |
+
Every day, activities are recorded either by the Driller, Mud Logger, MWD / LWD engineer or the Drilling Operations Coordinator throughout the day. \
|
| 69 |
+
As a DE representative for your company, you are required to prepare the 24-hour summary for the Daily Drilling Report (DDR) based on the hourly activities reported. \
|
| 70 |
+
You must always maintain the language of report along with the terminologies and mnemonics of the Drilling Engineer. \
|
| 71 |
+
Given the following activities for well XX, please prepare the 24-hour summary for the Daily Drilling Report (DDR). \
|
| 72 |
+
Only return the 24-hour summary, and nothing else.
|
| 73 |
+
"""
|
| 74 |
+
|
| 75 |
+
hourly_events = """00:00 - 11:00: Packed equipment and prepared for backload. Cleaned drillfloor and cantilever.
|
| 76 |
+
11:00 - 17:00: Performed are inspection with barge engineer. Cleaned and tidied offices and workspace. Demobilized all personell. End of operation
|
| 77 |
+
"""
|
| 78 |
+
|
| 79 |
+
input = TEMPLATE.format(instruction=INSTRUCTION, input=hourly_events)
|
| 80 |
+
|
| 81 |
+
output = pipeline(input)
|
| 82 |
+
|
| 83 |
+
print("Response: ", output[0]["generated_text"].split("### Response:")[1].strip())
|
| 84 |
+
# > Response: Packed equipment and prepared for backload. Cleaned drillfloor and cantilever. Performed are inspection with barge engineer. Cleaned and tidyied offices and workspaces.
|
| 85 |
+
```
|