Spaces:
Running
Running
A newer version of the Gradio SDK is available:
6.5.1
AI Friends Talk - Gradio Deployment Guide
π Watch 3 AI friends with different personalities debate fun topics!
π¨ IMPORTANT: Deployment Error Fix
If you get the error "It appears that one or more of your files contain valid Hugging Face secrets", follow these steps:
For Hugging Face Spaces Deployment (CORRECT WAY)
Method 1: Manual Upload (Recommended)
Create a new Space at https://huggingface.co/spaces
Upload ONLY these files:
AI_Talk_Gradio.pyrequirements.txt.gitignore(optional)
DO NOT upload these files:
- β
.env(contains API keys) - β
__pycache__/folders - β
.gradio/folders - β Certificate files (
.pem)
- β
Add API keys as Secrets in Space settings:
- Go to your Space β Settings β Repository secrets
- Add:
GROQ_API_KEY= your_groq_api_key - Add:
GOOGLE_API_KEY= your_google_api_key
Space will auto-deploy with the secrets!
Method 2: Using huggingface_hub (Advanced)
from huggingface_hub import HfApi
api = HfApi()
api.upload_file(
path_or_fileobj="AI_Talk_Gradio.py",
path_in_repo="AI_Talk_Gradio.py",
repo_id="your_username/your_space_name",
repo_type="space"
)
api.upload_file(
path_or_fileobj="requirements.txt",
path_in_repo="requirements.txt",
repo_id="your_username/your_space_name",
repo_type="space"
)
For Local Development
- Install dependencies:
pip install -r requirements.txt
- Create
.envfile:
GROQ_API_KEY=your_groq_api_key_here
GOOGLE_API_KEY=your_google_api_key_here
- Run the app:
python AI_Talk_Gradio.py
π€ AI Characters
- π Alex (Groq llama3-70b): Witty debater
- π Blake (Gemini 2.0): Creative optimist
- π§ Charlie (Gemini 1.5): Logical analyst
β¨ Features
- π Multi-language support (English/TiαΊΏng Viα»t/Deutsch)
- π― Custom or predefined topics
- π¬ Join the conversation as 4th participant
- π¨ Beautiful gradient UI with animations
- π± Mobile responsive design
- π Auto-conversation flow
- β‘ Real-time AI responses
π Files Structure for Deployment
AI_Game/
βββ AI_Talk_Gradio.py β
Main app file
βββ requirements.txt β
Dependencies
βββ .gitignore β
Ignore sensitive files
βββ README_Deploy.md βΉοΈ This guide
βββ .env β DO NOT UPLOAD (contains secrets)
βββ __pycache__/ β DO NOT UPLOAD (Python cache)
π API Keys Required
- Groq API Key: Get from https://console.groq.com/
- Google API Key: Get from https://ai.google.dev/gemini-api
π§ Troubleshooting
- "BadRequestError: secrets detected": Remove
.envfile from upload - "Model not found": Check API keys in Space secrets
- "Port already in use": App auto-selects available port
- Import errors: Verify
requirements.txtis uploaded
Made by Digitized Brains π§