Spaces:
Running
on
Zero
Running
on
Zero
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() | |