Spaces:
Runtime error

AL_hakemAI / app.py
Emad2012's picture
Create app.py
17f2ac7 verified
Raw History Blame Contribute Delete
579 Bytes
import gradio as gr
from transformers import pipeline
# نموذج ذكي مجاني
chatbot = pipeline("text-generation", model="distilgpt2")
def hakem_ai(user_input):
prompt = f"""
You are AL_HAKEM AI.
You are powerful, intelligent, and confident.
Answer in Arabic or English.
User: {user_input}
AI:
"""
response = chatbot(prompt, max_length=200, num_return_sequences=1)
return response[0]['generated_text']
iface = gr.Interface(
fn=hakem_ai,
inputs="text",
outputs="text",
title="👑 AL_HAKEM AI"
)
iface.launch()