Instructions to use InfometryINC/phi2-retail-sql-lora-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use InfometryINC/phi2-retail-sql-lora-v1 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2") model = PeftModel.from_pretrained(base_model, "InfometryINC/phi2-retail-sql-lora-v1") - Transformers
How to use InfometryINC/phi2-retail-sql-lora-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="InfometryINC/phi2-retail-sql-lora-v1")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("InfometryINC/phi2-retail-sql-lora-v1", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use InfometryINC/phi2-retail-sql-lora-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "InfometryINC/phi2-retail-sql-lora-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InfometryINC/phi2-retail-sql-lora-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/InfometryINC/phi2-retail-sql-lora-v1
- SGLang
How to use InfometryINC/phi2-retail-sql-lora-v1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "InfometryINC/phi2-retail-sql-lora-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InfometryINC/phi2-retail-sql-lora-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "InfometryINC/phi2-retail-sql-lora-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InfometryINC/phi2-retail-sql-lora-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use InfometryINC/phi2-retail-sql-lora-v1 with Docker Model Runner:
docker model run hf.co/InfometryINC/phi2-retail-sql-lora-v1
Admin commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -6,6 +6,9 @@ tags:
|
|
| 6 |
- base_model:adapter:microsoft/phi-2
|
| 7 |
- lora
|
| 8 |
- transformers
|
|
|
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
# Model Card for Model ID
|
|
@@ -22,19 +25,19 @@ tags:
|
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
-
- **Developed by:** [
|
| 26 |
-
- **Funded by [optional]:** [
|
| 27 |
-
- **Shared by [optional]:** [
|
| 28 |
-
- **Model type:** [
|
| 29 |
-
- **Language(s) (NLP):** [
|
| 30 |
-
- **License:** [
|
| 31 |
-
- **Finetuned from model [optional]:** [
|
| 32 |
|
| 33 |
### Model Sources [optional]
|
| 34 |
|
| 35 |
<!-- Provide the basic links for the model. -->
|
| 36 |
|
| 37 |
-
- **Repository:** [More Information Needed]
|
| 38 |
- **Paper [optional]:** [More Information Needed]
|
| 39 |
- **Demo [optional]:** [More Information Needed]
|
| 40 |
|
|
|
|
| 6 |
- base_model:adapter:microsoft/phi-2
|
| 7 |
- lora
|
| 8 |
- transformers
|
| 9 |
+
- text-to-sql
|
| 10 |
+
- nlp
|
| 11 |
+
license: apache-2.0
|
| 12 |
---
|
| 13 |
|
| 14 |
# Model Card for Model ID
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
+
- **Developed by:** [Infometry INC]
|
| 29 |
+
- **Funded by [optional]:** [Self-funded]
|
| 30 |
+
- **Shared by [optional]:** [Infometry INC]
|
| 31 |
+
- **Model type:** [LoRA fine-tuned causal language model]
|
| 32 |
+
- **Language(s) (NLP):** [SQL, English]
|
| 33 |
+
- **License:** [apache-2.0]
|
| 34 |
+
- **Finetuned from model [optional]:** [microsoft/phi-2]
|
| 35 |
|
| 36 |
### Model Sources [optional]
|
| 37 |
|
| 38 |
<!-- Provide the basic links for the model. -->
|
| 39 |
|
| 40 |
+
- **Repository:** [[More Information Needed](https://huggingface.co/YOUR_USERNAME/YOUR_MODEL_NAME)]
|
| 41 |
- **Paper [optional]:** [More Information Needed]
|
| 42 |
- **Demo [optional]:** [More Information Needed]
|
| 43 |
|