Views
No views yet
pip install transformers torch1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3# Load model
4model_name = "CHATMOBOT/mobot-ghana-complete"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(model_name)
7
8# Chat with MOBOT
9user_input = "Hey Mobot, send 50 cedis to Ama"
10prompt = f"<s>[INST] You are MOBOT, Ghana's friendly financial assistant.\n\nUser: {user_input} [/INST]"
11
12inputs = tokenizer(prompt, return_tensors="pt")
13outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.2)
14response = tokenizer.decode(outputs[0], skip_special_tokens=True)
15
16print(response)1from transformers import pipeline
2
3mobot = pipeline(
4 "text-generation",
5 model="CHATMOBOT/mobot-ghana-complete"
6)
7
8response = mobot(
9 "User: How much did I spend this week?",
10 max_new_tokens=512,
11 temperature=0.2
12)User: Send 50 cedis to Kwame
Mobot: Sure! I'll send ₵50 to Kwame. Please confirm?User: [Uploads ECG bill photo]
Mobot: I found an ECG bill for ₵100.00 (ref: REF123). Would you like me to pay it?User: [Voice] "Chale send 20 ghs to Ama"
Mobot: Okay boss, sending ₵20 to Ama. Please confirm?User: Help me save money
Mobot: Great question! Here are some tips:
1. Set a monthly savings goal
2. Automate transfers to savings
3. Track your spending
Want more advice?1# See: integrations/whatsapp_webhook_example.py
2# Full WhatsApp Business API integration1# See: integrations/telegram_bot_example.py
2# Interactive bot with buttons1# See: agents/orchestrator.py
2# Multi-step workflowstraining_config.yaml1# OCR for bills
2from scripts.multimodal.ocr_receipts import process_image
3parsed = process_image("bill.jpg")
4
5# STT for voice
6from scripts.multimodal.stt_whisper import transcribe_audio
7transcript = transcribe_audio("voice_note.mp3")
8
9# TTS for replies
10from services.tts_service import synthesize_text
11audio = synthesize_text("Hello! I'm MOBOT.")1from agents.orchestrator import AgentOrchestrator
2
3orchestrator = AgentOrchestrator()
4plan = orchestrator.plan("Pay this bill", context={"image": "bill.jpg"})
5result = orchestrator.execute(plan, user_id="user123")