Instructions to use samos123/gemma-7b-sql with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use samos123/gemma-7b-sql with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="samos123/gemma-7b-sql")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("samos123/gemma-7b-sql") model = AutoModelForCausalLM.from_pretrained("samos123/gemma-7b-sql", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use samos123/gemma-7b-sql with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "samos123/gemma-7b-sql" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "samos123/gemma-7b-sql", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/samos123/gemma-7b-sql
- SGLang
How to use samos123/gemma-7b-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 "samos123/gemma-7b-sql" \ --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": "samos123/gemma-7b-sql", "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 "samos123/gemma-7b-sql" \ --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": "samos123/gemma-7b-sql", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use samos123/gemma-7b-sql with Docker Model Runner:
docker model run hf.co/samos123/gemma-7b-sql
| NeMo-Aligner/examples/nlp/gpt/train_gpt_sft.py name=gemma-7b-sql-nemo trainer.precision=bf16 trainer.num_nodes=1 trainer.devices=8 trainer.sft.max_steps=-1 trainer.sft.limit_val_batches=40 trainer.sft.val_check_interval=1000 model.tensor_model_parallel_size=4 model.pipeline_model_parallel_size=1 model.megatron_amp_O2=True model.restore_from_path=/workspace/models/pytorch-7b-pt.nemo model.optim.lr=5e-6 model.answer_only_loss=True ++model.bias_activation_fusion=true model.data.num_workers=0 model.data.train_ds.micro_batch_size=1 model.data.train_ds.global_batch_size=128 model.data.train_ds.max_seq_length=8192 model.data.train_ds.file_path=nsql.jsonl model.data.validation_ds.micro_batch_size=1 model.data.validation_ds.global_batch_size=128 model.data.validation_ds.drop_last=True model.data.validation_ds.file_path=nsql.jsonl exp_manager.explicit_log_dir=models/gemma-7b-sql-nemo exp_manager.checkpoint_callback_params.save_nemo_on_train_end=True exp_manager.resume_if_exists=True exp_manager.resume_ignore_no_checkpoint=True exp_manager.create_checkpoint_callback=True exp_manager.checkpoint_callback_params.monitor=validation_loss |