Text Generation
Transformers
PyTorch
English
gemma
code
text2text-generation
text-generation-inference
Instructions to use Kasivs/SQLGenerator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kasivs/SQLGenerator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kasivs/SQLGenerator")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kasivs/SQLGenerator") model = AutoModelForCausalLM.from_pretrained("Kasivs/SQLGenerator") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kasivs/SQLGenerator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kasivs/SQLGenerator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kasivs/SQLGenerator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Kasivs/SQLGenerator
- SGLang
How to use Kasivs/SQLGenerator 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 "Kasivs/SQLGenerator" \ --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": "Kasivs/SQLGenerator", "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 "Kasivs/SQLGenerator" \ --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": "Kasivs/SQLGenerator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Kasivs/SQLGenerator with Docker Model Runner:
docker model run hf.co/Kasivs/SQLGenerator
Delete Save_as_json
Browse files- Save_as_json +0 -13
Save_as_json
DELETED
|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
|
| 3 |
-
config = {
|
| 4 |
-
"model_type": "bert",
|
| 5 |
-
"hidden_size": 768,
|
| 6 |
-
"num_attention_heads": 12,
|
| 7 |
-
"num_hidden_layers": 12,
|
| 8 |
-
"vocab_size": 30522,
|
| 9 |
-
"max_position_embeddings": 512
|
| 10 |
-
}
|
| 11 |
-
|
| 12 |
-
with open("config.json", "w") as f:
|
| 13 |
-
json.dump(config, f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|