Refactored the README
Browse files
README.md
CHANGED
|
@@ -12,4 +12,66 @@ tags:
|
|
| 12 |
language:
|
| 13 |
- en
|
| 14 |
pipeline_tag: text2text-generation
|
| 15 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
language:
|
| 13 |
- en
|
| 14 |
pipeline_tag: text2text-generation
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# 🛢💬 Querypls-Prompt2SQL
|
| 18 |
+
|
| 19 |
+
## Overview
|
| 20 |
+
|
| 21 |
+
Querypls-Prompt2SQL is a 💬 text-to-SQL generation model developed by [samadpls](https://github.com/samadpls). It is designed for generating SQL queries based on user prompts.
|
| 22 |
+
|
| 23 |
+
## Model Details
|
| 24 |
+
|
| 25 |
+
- **License:** Apache-2.0
|
| 26 |
+
- **Datasets:**
|
| 27 |
+
- [samadpls/querypls-prompt2sql-dataset](https://huggingface.co/datasets/samadpls/querypls-prompt2sql-dataset)
|
| 28 |
+
- [b-mc2/sql-create-context](https://huggingface.co/datasets/b-mc2/sql-create-context)
|
| 29 |
+
- **Tags:**
|
| 30 |
+
- stabilityai/StableBeluga-7B
|
| 31 |
+
- langchain
|
| 32 |
+
- opensource
|
| 33 |
+
- stabilityai
|
| 34 |
+
- SatbleBeluga-7B
|
| 35 |
+
- **Language(s):** English
|
| 36 |
+
- **Pipeline Tag:** Text2Text Generation
|
| 37 |
+
|
| 38 |
+
## Model Usage
|
| 39 |
+
|
| 40 |
+
To get started with the model in Python, you can use the following code:
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from transformers import pipeline, AutoTokenizer
|
| 44 |
+
|
| 45 |
+
question = "how to get all employees from table0"
|
| 46 |
+
prompt = f'Your task is to create SQL query of the following {question}, just SQL query and no text'
|
| 47 |
+
|
| 48 |
+
tokenizer = AutoTokenizer.from_pretrained("samadpls/querypls-prompt2sql")
|
| 49 |
+
pipe = pipeline(task='text-generation', model="samadpls/querypls-prompt2sql", tokenizer=tokenizer, max_length=200)
|
| 50 |
+
|
| 51 |
+
result = pipe(prompt)
|
| 52 |
+
print(result[0]['generated_text'])
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
Adjust the `question` variable with the desired question, and the generated SQL query will be printed.
|
| 56 |
+
|
| 57 |
+
## Training Details
|
| 58 |
+
|
| 59 |
+
The model was trained on Google Colab, and its purpose is to be used in the [Querypls](https://github.com/samadpls/Querypls) project with the following training and validation loss progression:
|
| 60 |
+
|
| 61 |
+
```yaml
|
| 62 |
+
Copy code
|
| 63 |
+
Step Training Loss Validation Loss
|
| 64 |
+
943 2.332100 2.652054
|
| 65 |
+
1886 2.895300 2.551685
|
| 66 |
+
2829 2.427800 2.498556
|
| 67 |
+
3772 2.019600 2.472013
|
| 68 |
+
4715 3.391200 2.465390
|
| 69 |
+
```
|
| 70 |
+
`However, note that the model may be too large to load in certain environments.`
|
| 71 |
+
|
| 72 |
+
For more information and details, please refer to the provided [documentation](https://huggingface.co/stabilityai/StableBeluga-7B).
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
## Model Card Authors
|
| 76 |
+
|
| 77 |
+
- 🤖 [samadpls](https://github.com/samadpls)
|