File size: 595 Bytes
ef5cf7c
 
 
f2c30d1
ef5cf7c
f2c30d1
 
 
 
 
 
ef5cf7c
f2c30d1
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from llama_cpp import Llama
import gradio as gr

MODEL_URL = "https://huggingface.co/eliza555beth2002/DeepSeek-R1-Distill-Text2SQL-OneEpoch-GGUF-q4/resolve/main/model.gguf"

llm = Llama(
    model_path=MODEL_URL,  # можно подставить ссылку на модель
    n_ctx=4096,
    n_threads=4,
    n_gpu_layers=50,
)

def text2sql(question):
    prompt = f"Создай SQL-запрос для вопроса: {question}"
    output = llm(prompt)
    return output['choices'][0]['text']

gr.Interface(fn=text2sql, inputs="text", outputs="text", title="Text2SQL Demo").launch()