Spaces:
Sleeping
Sleeping
| 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() | |