Spaces:
Runtime error

File size: 579 Bytes
17f2ac7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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()