eliza555beth2002 commited on
Commit
ef5cf7c
·
verified ·
1 Parent(s): 87962e8

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from llama_cpp import Llama
2
+ import gradio as gr
3
+
4
+ # Загружаем твою GGUF-модель (добавь файл модели в этот Space)
5
+ model = Llama(model_path="DeepSeek-R1-Distill-Text2SQL-OneEpoch-GGUF-q4.gguf")
6
+
7
+ def generate_sql(prompt):
8
+ result = model(prompt, max_tokens=256)
9
+ return result["choices"][0]["text"]
10
+
11
+ gr.Interface(
12
+ fn=generate_sql,
13
+ inputs="text",
14
+ outputs="text",
15
+ title="DeepSeek Text2SQL",
16
+ description="Вводи вопрос на естественном языке и получай SQL-запрос."
17
+ ).launch()