Instructions to use omdbusiness/amal with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use omdbusiness/amal with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf omdbusiness/amal:Q4_K_M # Run inference directly in the terminal: llama cli -hf omdbusiness/amal:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf omdbusiness/amal:Q4_K_M # Run inference directly in the terminal: llama cli -hf omdbusiness/amal:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf omdbusiness/amal:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf omdbusiness/amal:Q4_K_M
Use Docker
docker model run hf.co/omdbusiness/amal:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use omdbusiness/amal with Ollama:
ollama run hf.co/omdbusiness/amal:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use omdbusiness/amal with Docker Model Runner:
docker model run hf.co/omdbusiness/amal:Q4_K_M
- Lemonade
How to use omdbusiness/amal with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull omdbusiness/amal:Q4_K_M
Run and chat with the model
lemonade run user.amal-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Download learner.py from omdbusiness/amal: direct link, hf CLI and curl.
- Browser
- Download file 4.4 kB
-
https://huggingface.co/omdbusiness/amal/resolve/main/learner.py
- Command line
-
hf download hf://omdbusiness/amal/learner.py
-
curl -L -o learner.py https://huggingface.co/omdbusiness/amal/resolve/main/learner.py
4.4 kB
| import requests | |
| from bs4 import BeautifulSoup | |
| import json | |
| import os | |
| from difflib import get_close_matches | |
| from analyzer import fix_url, detect_media_type | |
| from memory import load_memory, save_memory, load_global_memory, save_global_memory | |
| LEARNING_FILE = "learned_links.json" | |
| SEARCH_QUERY = "websites to learn something new every day" | |
| SEARCH_ENGINE_URL = f"https://html.duckduckgo.com/html/?q={SEARCH_QUERY}" | |
| # الردود التلقائية الذكية | |
| def auto_answer(message): | |
| message = message.strip().lower() | |
| if message.startswith("هل ابدأ") or message.startswith("ابدأ") or message in ["هل نبدأ؟", "ابدأ؟", "ابدا"]: | |
| return "نعم ابدأ" | |
| elif message in ["نعم", "لا", "نعم أو لا", "نعم او لا"]: | |
| return "نعم" | |
| elif "أو" in message or "او" in message: | |
| return message.split()[0] | |
| elif message.startswith("هل تريدني") or message.startswith("هل تود") or message.startswith("هل تبي") or message.startswith("اذا تبي"): | |
| return "نعم" | |
| elif message.startswith("هل تحتاج"): | |
| return "نعم اكمل مع تفعيل الاجابات التلقائية" | |
| elif message.startswith("ما هي"): | |
| return "ليس الآن" | |
| elif "تفصيل" in message: | |
| return "ليس الآن" | |
| elif message.startswith("قول لي"): | |
| return "موافق" | |
| elif "جاهز" in message: | |
| return "ابدأ" | |
| elif message.startswith("هل تريد"): | |
| return "نعم" | |
| elif "هل تحتاج شيء آخر" in message or "هل تحتاج لشيء اخر" in message: | |
| return "نعم اكمل مع تفعيل الاجابات التلقائية" | |
| return None | |
| # المجيب الذكي | |
| def generate_reply(message, username="مجهول"): | |
| global_memory = load_global_memory() | |
| auto = auto_answer(message) | |
| if auto: | |
| return auto | |
| if message in global_memory: | |
| return global_memory[message] | |
| matches = get_close_matches(message, global_memory.keys(), n=1, cutoff=0.6) | |
| if matches: | |
| return global_memory[matches[0]] | |
| if message.startswith("http://") or message.startswith("https://"): | |
| media_type = detect_media_type(message) | |
| if media_type == 'image': | |
| reply = f'<img src="{message}" alt="صورة" width="300">' | |
| elif media_type == 'video': | |
| reply = f'<video controls width="300"><source src="{message}"></video>' | |
| elif media_type == 'audio': | |
| reply = f'<audio controls><source src="{message}"></audio>' | |
| else: | |
| reply = f'<a href="{message}" target="_blank">رابط خارجي</a>' | |
| else: | |
| reply = f"رد تلقائي: {message[::-1]}" | |
| if '//' in message: | |
| words = message.split() | |
| for i in range(len(words)): | |
| if '//' in words[i]: | |
| words[i] = fix_url(words[i]) | |
| reply += "\nمصدر خارجي بعد التصحيح: " + " ".join(words) | |
| global_memory[message] = reply | |
| save_global_memory(global_memory) | |
| return reply | |
| # تعليم تلقائي | |
| def fetch_learning_links(): | |
| headers = { | |
| "User-Agent": "Mozilla/5.0" | |
| } | |
| try: | |
| response = requests.get(SEARCH_ENGINE_URL, headers=headers, timeout=10) | |
| soup = BeautifulSoup(response.text, "html.parser") | |
| except Exception as e: | |
| print("فشل في الاتصال بمصدر التعلم:", e) | |
| return [] | |
| links = [] | |
| for a in soup.find_all("a", href=True): | |
| href = a['href'] | |
| if "http" in href or href.startswith("//"): | |
| clean_link = fix_url(href) | |
| if clean_link not in links: | |
| links.append(clean_link) | |
| return links[:10] | |
| def save_learned_links(links): | |
| with open(LEARNING_FILE, "w", encoding="utf-8") as f: | |
| json.dump(links, f, indent=2, ensure_ascii=False) | |
| def auto_learn(): | |
| try: | |
| links = fetch_learning_links() | |
| save_learned_links(links) | |
| memory = load_global_memory() | |
| for link in links: | |
| if link not in memory: | |
| memory[link] = f"تعلمت من الرابط: {link}" | |
| save_global_memory(memory) | |
| print("تم التعلّم التلقائي وتحديث الذاكرة.") | |
| except Exception as e: | |
| print("نورا: حدث خطأ أثناء التعلّم:", str(e)) | |