File size: 445 Bytes
0ecc230
a53a69e
0ecc230
a53a69e
 
 
 
 
0ecc230
 
 
a53a69e
 
0ecc230
 
 
a53a69e
 
0ecc230
 
a53a69e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from transformers import pipeline

# استخدام النموذج مباشرة بدون LoRA
pipe = pipeline(
    "text-generation",
    model="deepseek-ai/deepseek-coder-1.3b-base",
    device_map="auto"
)

def generate_response(prompt):
    result = pipe(prompt, max_length=100)
    return result[0]['generated_text']

iface = gr.Interface(
    fn=generate_response,
    inputs="text",
    outputs="text"
)

iface.launch()