Spaces:
Sleeping
Sleeping
Download app.py from AlbaherTech/Albaher: direct link, hf CLI and curl.
- Browser
- Download file 484 Bytes
-
https://huggingface.co/spaces/AlbaherTech/Albaher/resolve/main/app.py
- Command line
-
hf download hf://spaces/AlbaherTech/Albaher/app.py
-
curl -L -o app.py https://huggingface.co/spaces/AlbaherTech/Albaher/resolve/main/app.py
484 Bytes
| import gradio as gr | |
| from huggingface_hub import InferenceClient | |
| client = InferenceClient(model="meta-llama/Llama-3.2-1B-Instruct") | |
| def chat(message, history): | |
| response = client.text_generation( | |
| message, | |
| max_new_tokens=200, | |
| temperature=0.7, | |
| top_p=0.9, | |
| ) | |
| return response | |
| gr.ChatInterface( | |
| fn=chat, | |
| title="Albaher AI Assistant", | |
| description="مساعد ذكاء صناعي مجاني يعمل عبر HuggingFace API" | |
| ).launch() | |