Run this model with HF Jobs
Run emirozturk/Phi-3-mini-4k-instruct-SQL on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/emirozturk/Phi-3-mini-4k-instruct-SQL. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/emirozturk/Phi-3-mini-4k-instruct-SQL on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/emirozturk/Phi-3-mini-4k-instruct-SQL. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/emirozturk/Phi-3-mini-4k-instruct-SQL. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use emirozturk/Phi-3-mini-4k-instruct-SQL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use emirozturk/Phi-3-mini-4k-instruct-SQL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="emirozturk/Phi-3-mini-4k-instruct-SQL", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("emirozturk/Phi-3-mini-4k-instruct-SQL", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("emirozturk/Phi-3-mini-4k-instruct-SQL", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use emirozturk/Phi-3-mini-4k-instruct-SQL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "emirozturk/Phi-3-mini-4k-instruct-SQL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "emirozturk/Phi-3-mini-4k-instruct-SQL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/emirozturk/Phi-3-mini-4k-instruct-SQL
- SGLang
How to use emirozturk/Phi-3-mini-4k-instruct-SQL 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 "emirozturk/Phi-3-mini-4k-instruct-SQL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "emirozturk/Phi-3-mini-4k-instruct-SQL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "emirozturk/Phi-3-mini-4k-instruct-SQL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "emirozturk/Phi-3-mini-4k-instruct-SQL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use emirozturk/Phi-3-mini-4k-instruct-SQL with Docker Model Runner:
docker model run hf.co/emirozturk/Phi-3-mini-4k-instruct-SQL
Upload folder using huggingface_hub
Browse filesFiles changed (11)
- .DS_StoreAdded
- adapter_config.jsonAdded+31
- adapter_model.safetensorsAdded+3
- config.jsonAdded+36
- optimizer.ptAdded+3
- rng_state.pthAdded+3
- scheduler.ptAdded+3
- tokenizer.jsonAdded
- tokenizer.modelAdded+3
- tokenizer_config.jsonAdded+130
- training_args.binAdded+3
12345678910111213141516171819202122232425262728293031{ "alpha_pattern": {}, "auto_mapping": null, "base_model_name_or_path": "microsoft/Phi-3-mini-4k-instruct", "bias": "none", "fan_in_fan_out": false, "inference_mode": true, "init_lora_weights": true, "layer_replication": null, "layers_pattern": null, "layers_to_transform": null, "loftq_config": {}, "lora_alpha": 16, "lora_dropout": 0.05, "megatron_config": null, "megatron_core": "megatron.core", "modules_to_save": null, "peft_type": "LORA", "r": 8, "rank_pattern": {}, "revision": null, "target_modules": [ "gate_up_proj", "qkv_proj", "o_proj", "down_proj" ], "task_type": "CAUSAL_LM", "use_dora": false, "use_rslora": false}123version https://git-lfs.github.com/spec/v1oid sha256:105d474bc27d28b84f7f30ce3e5eecf91c5dcf1cffa9a1ee3b5a1eb573eefc18size 50365768123456789101112131415161718192021222324252627282930313233343536{ "_name_or_path": "Phi-3-mini-4k-instruct", "architectures": [ "Phi3ForCausalLM" ], "attention_dropout": 0.0, "auto_map": { "AutoConfig": "configuration_phi3.Phi3Config", "AutoModelForCausalLM": "modeling_phi3.Phi3ForCausalLM" }, "bos_token_id": 1, "embd_pdrop": 0.0, "eos_token_id": 32000, "hidden_act": "silu", "hidden_size": 3072, "initializer_range": 0.02, "intermediate_size": 8192, "max_position_embeddings": 4096, "model_type": "phi3", "num_attention_heads": 32, "num_hidden_layers": 32, "num_key_value_heads": 32, "original_max_position_embeddings": 4096, "pad_token_id": 32000, "resid_pdrop": 0.0, "rms_norm_eps": 1e-05, "rope_scaling": null, "rope_theta": 10000.0, "sliding_window": 2047, "tie_word_embeddings": false, "torch_dtype": "bfloat16", "transformers_version": "4.39.3", "use_cache": true, "attention_bias": false, "vocab_size": 32064}123version https://git-lfs.github.com/spec/v1oid sha256:46077cf5060f0a7436f2d0bebdca10197dbf6740d6037ae968bbbe1d43cbb8e0size 100871290123version https://git-lfs.github.com/spec/v1oid sha256:f32726be9ef806dbbcd9e9dcb1279e6e63dc26f5579c19a506ffa7fd3b97fc04size 13990123version https://git-lfs.github.com/spec/v1oid sha256:feb4d7ca27424f2b599e030ee91b782d27019f33950a97aa9adc37db6444d3cesize 1064123version https://git-lfs.github.com/spec/v1oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347size 499723123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130{ "add_bos_token": true, "add_eos_token": false, "added_tokens_decoder": { "0": { "content": "<unk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "<s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": "</s>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": false }, "32000": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32001": { "content": "<|assistant|>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": true }, "32002": { "content": "<|placeholder1|>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": true }, "32003": { "content": "<|placeholder2|>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": true }, "32004": { "content": "<|placeholder3|>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": true }, "32005": { "content": "<|placeholder4|>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": true }, "32006": { "content": "<|system|>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": true }, "32007": { "content": "<|end|>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": true }, "32008": { "content": "<|placeholder5|>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": true }, "32009": { "content": "<|placeholder6|>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": true }, "32010": { "content": "<|user|>", "lstrip": false, "normalized": false, "rstrip": true, "single_word": false, "special": true } }, "bos_token": "<s>", "chat_template": "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') %}{{'<|user|>' + '\n' + message['content'] + '<|end|>' + '\n' + '<|assistant|>' + '\n'}}{% elif (message['role'] == 'assistant') %}{{message['content'] + '<|end|>' + '\n'}}{% endif %}{% endfor %}", "clean_up_tokenization_spaces": false, "eos_token": "<|endoftext|>", "legacy": false, "model_max_length": 4096, "pad_token": "<|endoftext|>", "padding_side": "left", "sp_model_kwargs": {}, "tokenizer_class": "LlamaTokenizer", "unk_token": "<unk>", "use_default_system_prompt": false}123version https://git-lfs.github.com/spec/v1oid sha256:cc79b321dba3f4aadcc3341fba717b45b78b009862f684dcbd0f549311d31739size 5112.DS_StoreAdded
adapter_config.jsonAdded+31
adapter_model.safetensorsAdded+3
config.jsonAdded+36
optimizer.ptAdded+3
rng_state.pthAdded+3
scheduler.ptAdded+3
tokenizer.jsonAdded
tokenizer.modelAdded+3
tokenizer_config.jsonAdded+130
training_args.binAdded+3