File size: 743 Bytes
b2e1dba
0ff1aee
f7906ff
0ff1aee
b2e1dba
3ead256
0ff1aee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6ea3a2b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from transformers import pipeline
import gradio as gr

# تحميل النموذج
pipe = pipeline("text-generation", model="wasmdashai/Seed-Coder-8B-Instruct-V1")

# دالة توليد الردود
def chat_with_model(user_input):
    messages = [
        {"role": "user", "content": user_input},
    ]
    output = pipe(messages, max_new_tokens=200, do_sample=True)
    return output[0]['generated_text']

# واجهة Gradio
gr.Interface(
    fn=chat_with_model,
    inputs=gr.Textbox(lines=2, placeholder="اكتب سؤالك هنا..."),
    outputs="text",
    title="Seed-Coder Chat",
    description="نموذج Seed-Coder للإجابة على الأسئلة باستخدام نموذج توليد النصوص"
).launch(share=True)