shangrilar/ko_text2sql
Viewer • Updated • 67.2k • 268 • 19
How to use thenewth/EXAONE-4-32B-text2sql with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="thenewth/EXAONE-4-32B-text2sql")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("thenewth/EXAONE-4-32B-text2sql")
model = AutoModelForCausalLM.from_pretrained("thenewth/EXAONE-4-32B-text2sql")
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=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use thenewth/EXAONE-4-32B-text2sql with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "thenewth/EXAONE-4-32B-text2sql"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "thenewth/EXAONE-4-32B-text2sql",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/thenewth/EXAONE-4-32B-text2sql
How to use thenewth/EXAONE-4-32B-text2sql with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "thenewth/EXAONE-4-32B-text2sql" \
--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": "thenewth/EXAONE-4-32B-text2sql",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "thenewth/EXAONE-4-32B-text2sql" \
--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": "thenewth/EXAONE-4-32B-text2sql",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use thenewth/EXAONE-4-32B-text2sql with Docker Model Runner:
docker model run hf.co/thenewth/EXAONE-4-32B-text2sql
한국어로 작성된 자연어 질문을 SQL 쿼리로 변환하는 텍스트2SQL 모델입니다.
LGAI-EXAONE 기반으로 한국어 데이터에 특화된 파인튜닝 진행.
한국어 기반의 SQL 생성이 필요한 데이터 분석 툴이나 챗봇 등에 사용 가능.
비정형 질문이나 데이터베이스 구조가 명확하지 않은 경우 정확도가 떨어질 수 있음.
Base model
LGAI-EXAONE/EXAONE-4.0-32B