Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.2.0
metadata
license: mit
title: Ibi-Voice Translation Backend
sdk: gradio
emoji: π
colorFrom: blue
colorTo: pink
short_description: JR Digital Insights - Professional English to Ibibio transla
sdk_version: 5.35.0
π― Ibi-Voice Translation Backend
JR Digital Insights - AI-powered Ibibio translation service on Hugging Face Spaces
π Quick Setup
1. Get Your API Keys
Groq API Key (Free)
- Go to console.groq.com
- Sign up/login
- Navigate to "API Keys"
- Create new key
- Copy the key (starts with
gsk_...)
Tavily Search API Key (Free Tier)
- Go to tavily.com
- Sign up for free account
- Get your API key from dashboard
- Copy the key (starts with
tvly-...)
2. Configure Hugging Face Space
- In your HF Space, click "Settings" tab
- Scroll to "Repository secrets"
- Add these secrets:
Name: GROQ_API_KEY Value: your_groq_key_here Name: TAVILY_API_KEY Value: your_tavily_key_here - Click "Add secret" for each
3. Upload Files
Upload these files to your HF Space:
app.py(main backend code)requirements.txt(dependencies)README.md(this file)
π API Usage
Frontend Integration
// Connect your Ibi-Voice frontend to this backend
async function translateOnline(query) {
const response = await fetch('https://your-username-ibi-voice-backend.hf.space/api/predict', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
data: [query],
fn_index: 0 // First function in Gradio interface
})
});
const result = await response.json();
return result.data[0];
}
// Usage example
translateOnline("What is 'God is good' in Ibibio?")
.then(translation => console.log(translation));
Direct API Call
curl -X POST "https://your-username-ibi-voice-backend.hf.space/api/predict" \
-H "Content-Type: application/json" \
-d '{
"data": ["What is God is good in Ibibio?"],
"fn_index": 0
}'
π§ Features
- π§ AI Reasoning: Uses Groq LLaMA3-8B for intelligent translation analysis
- π Web Search: Real-time lookup via Tavily API for current information
- π Local Dictionary: Built-in fallback for common Ibibio phrases
- π― Smart Combining: Merges all sources for best possible translation
π Testing Queries
Try these example queries:
- "What is 'God is good' in Ibibio?"
- "How do you say 'thank you' in Ibibio?"
- "Translate 'good morning' to Ibibio"
- "What does 'sosongo' mean in English?"
π― Next Steps
- Deploy this backend to HF Spaces
- Test the API endpoints
- Integrate with your Ibi-Voice React frontend
- Add more local dictionary entries as needed
Built for JR Digital Insights | Ibibio Language Preservation Project