A newer version of the Gradio SDK is available:
6.0.0
π How to Add HuggingFace Token to Your Space
The AlgoSpeak AI app needs a HuggingFace token to access the Mistral-7B model for better translation quality.
Why do I need this?
- Without token: Uses Google Flan-T5 (smaller, limited quality)
- With token: Uses Mistral-7B (better understanding, higher quality)
Step-by-Step Instructions
1. Create a HuggingFace Access Token
- Go to HuggingFace Settings β Tokens
- Click "New token"
- Give it a name like
algospeak-space - Select permission: Read (sufficient for inference)
- Click "Generate"
- Copy the token (you won't see it again!)
2. Add Token as Secret to Your Space
- Go to your Space: https://huggingface.co/spaces/Veronyka/algospeak
- Click on "Settings" tab (βοΈ)
- Scroll to "Repository secrets" section
- Click "New secret"
- Fill in:
- Name:
HF_TOKEN - Value: Paste your token here
- Name:
- Click "Add secret"
3. Restart Your Space
- Go to "Settings" β "Factory reboot"
- Or just wait ~1 minute for automatic restart
4. Verify It's Working
- The app header should now show:
π€ Current Model: mistralai/Mistral-7B-Instruct-v0.3 - Translations should be more contextual and higher quality
Troubleshooting
Still seeing errors?
- Check if the secret name is exactly
HF_TOKEN(case-sensitive) - Make sure your token has "Read" permission
- Try Factory reboot in Settings
Token not being used?
- The app will automatically detect the token via environment variable
- No code changes needed!
Security Note: Secrets in HF Spaces are encrypted and not visible to visitors. Only the Space owner can see/edit them.