Spaces:
Runtime error
Runtime error
Download app.py from Emad2012/AL_hakemAI: direct link, hf CLI and curl.
- Browser
- Download file 579 Bytes
-
https://huggingface.co/spaces/Emad2012/AL_hakemAI/resolve/main/app.py
- Command line
-
hf download hf://spaces/Emad2012/AL_hakemAI/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Emad2012/AL_hakemAI/resolve/main/app.py
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() |