Instructions to use tdoehmen/starcoder-schemapile-fk with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tdoehmen/starcoder-schemapile-fk with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tdoehmen/starcoder-schemapile-fk")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tdoehmen/starcoder-schemapile-fk") model = AutoModelForCausalLM.from_pretrained("tdoehmen/starcoder-schemapile-fk") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use tdoehmen/starcoder-schemapile-fk with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tdoehmen/starcoder-schemapile-fk" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tdoehmen/starcoder-schemapile-fk", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tdoehmen/starcoder-schemapile-fk
- SGLang
How to use tdoehmen/starcoder-schemapile-fk 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 "tdoehmen/starcoder-schemapile-fk" \ --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": "tdoehmen/starcoder-schemapile-fk", "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 "tdoehmen/starcoder-schemapile-fk" \ --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": "tdoehmen/starcoder-schemapile-fk", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tdoehmen/starcoder-schemapile-fk with Docker Model Runner:
docker model run hf.co/tdoehmen/starcoder-schemapile-fk
SchemaPile Foreign Key Detection Model (Starcoder)
Model Description
In this repository we are introducing starcoder-schemapile-fk. It's a language model, based on BigCode/starcoder fine-tuned for predicting foreign key relationships in relational database schemas.
Training Data
Forein key pairs extracted from SchemaPile-Perm, a large collection of relational database schemas.
Evaluation Data
We evaluate the foreign key detection accuracy of starcoder-schemapile-fk and t5-schemapile-fk on schemas from Spider, BIRD-SQL, and CTU PRLR.
Training Procedure
The model was trained, using 4x A100 40GB GPUs with DeepSpeed ZeRO-3 offloading, and following hyperparamters:
- learning_rate: 2.0e-05
- num_train_epochs: 3
- gradient_accumulation_steps: 8
- per_device_train_batch_size: 4
- bf16: true
- warmup_ratio: 0.03
- weight_decay: 0.0
See Training Code.
How to Use
We recommend using the provided prompt template and constrained output using jsonformer:
Example Prompt:
You are given the following SQL database tables:
staff(staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff)
addresses(address_id, line_1_number_building, city, zip_postcode, state_province_county, country)
Output a json string with the following schema {table, column, referencedTable, referencedColumn} that contains the foreign key relationship between the two tables.
Example Output:
{'table': 'staff',
'column': 'staff_address_id',
'referencedTable': 'addresses',
'referencedColumn': 'address_id'}
To run the model locally, we recommend using our end-to-end Example Notebook (requires a single A100 40GB).
- Downloads last month
- 3