Update README.md
Browse files
README.md
CHANGED
|
@@ -17,6 +17,8 @@ pipeline_tag: text-generation
|
|
| 17 |
|
| 18 |
# Regex-AI-Llama-3.2-1B
|
| 19 |
|
|
|
|
|
|
|
| 20 |
This model is a fine-tuned version of `meta-llama/Llama-3.2-1B-Instruct` specifically trained on the `phongo/RegEx` dataset for generating regular expressions. It aims to provide accurate and efficient regex solutions based on natural language descriptions of the desired pattern.
|
| 21 |
|
| 22 |
## Model Description
|
|
@@ -35,4 +37,26 @@ This model is intended for generating regular expressions based on natural langu
|
|
| 35 |
* **Complexity:** The model may struggle with extremely complex or nuanced regex patterns.
|
| 36 |
* **Ambiguity:** Ambiguous natural language descriptions can lead to inaccurate regexes. Be as precise and clear as possible in your prompts.
|
| 37 |
* **Edge Cases:** The model might not cover all possible edge cases in regex syntax.
|
| 38 |
-
* **Security:** Always validate and sanitize generated regexes before using them in production environments to prevent potential security vulnerabilities (e.g., ReDoS attacks).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
# Regex-AI-Llama-3.2-1B
|
| 19 |
|
| 20 |
+
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
| 21 |
+
|
| 22 |
This model is a fine-tuned version of `meta-llama/Llama-3.2-1B-Instruct` specifically trained on the `phongo/RegEx` dataset for generating regular expressions. It aims to provide accurate and efficient regex solutions based on natural language descriptions of the desired pattern.
|
| 23 |
|
| 24 |
## Model Description
|
|
|
|
| 37 |
* **Complexity:** The model may struggle with extremely complex or nuanced regex patterns.
|
| 38 |
* **Ambiguity:** Ambiguous natural language descriptions can lead to inaccurate regexes. Be as precise and clear as possible in your prompts.
|
| 39 |
* **Edge Cases:** The model might not cover all possible edge cases in regex syntax.
|
| 40 |
+
* **Security:** Always validate and sanitize generated regexes before using them in production environments to prevent potential security vulnerabilities (e.g., ReDoS attacks).
|
| 41 |
+
|
| 42 |
+
## How to use
|
| 43 |
+
|
| 44 |
+
You can use this model with the following code:
|
| 45 |
+
```python
|
| 46 |
+
from llama_cpp import Llama
|
| 47 |
+
|
| 48 |
+
llm = Llama.from_pretrained(
|
| 49 |
+
repo_id="mishl/Regex-AI-Llama-3.2-1B",
|
| 50 |
+
filename="unsloth.Q4_K_M.gguf", # Or unsloth.F16.gguf
|
| 51 |
+
)
|
| 52 |
+
|
| 53 |
+
llm.create_chat_completion(
|
| 54 |
+
messages = [
|
| 55 |
+
{
|
| 56 |
+
"role": "user",
|
| 57 |
+
"content": "Create regex for masked links like this [website](www.example.com)"
|
| 58 |
+
}
|
| 59 |
+
]
|
| 60 |
+
)
|
| 61 |
+
```
|
| 62 |
+
|