Spaces:
Runtime error
Runtime error
Commit History
-
ποΈ Remove API Endpoints page to simplify the applicationβ
Removed the REST API Endpoints tab to create a cleaner, more focused interface: **Changes Made:** - Removed create_api_endpoints_page() import from app.py - Removed API endpoints page creation from interface - Updated py/pages/__init__.py to exclude api_endpoints export - Kept the API controller functionality (still runs on port 7861) **Current Interface Structure:** β π Single Text Analysis - Individual text sentiment analysis β π Batch Analysis - Multiple text processing β βΉοΈ Model Information - Model details and memory management **API Still Available:** - REST API server still runs on port 7861 - API endpoints still accessible at /analyze, /analyze/batch, /health - Interactive API docs still available at :7861/docs - No functional changes to API capabilities **Benefits:** - Cleaner, more focused user interface - Reduced complexity for end users - Simpler navigation with 3 core tabs - Maintains all API functionality for developers The application now provides a streamlined exβ¦9522fcb -
π Fix dynamic API URLs for local and Hugging Face Spaces deploymentβ
Updated API endpoints page to automatically detect environment and show correct URLs: **Local Development:** - Base URL: http://localhost:7861 - Shows "Local Development" environment indicator **Hugging Face Spaces:** - Base URL: https://your-space-name.hf.space:7861 - Shows "Hugging Face Spaces" environment indicator - Uses SPACE_ID and SPACE_NAME environment variables **Features:** - Automatic environment detection using os.getenv('SPACE_ID') - Dynamic URL generation for all API examples - Environment-aware documentation - Works seamlessly in both development and production All cURL, Python, and JavaScript examples now use the correct base URL automatically based on where the application is running. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>74bc2f3
-
π Major Refactor: Modular Architecture with Automatic Fine-Tuningβ
## ποΈ Architecture Changes: - Split monolithic app.py into modular pages structure - Created py/pages/ with separate files for each tab - Added REST API controller with FastAPI - Improved code organization and maintainability ## π± New Features: - Automatic fine-tuning if vietnamese_sentiment_finetuned model doesn't exist - REST API server running alongside Gradio (port 7861) - Interactive API documentation at /docs - Memory management and monitoring - Modular tab system for better code organization ## ποΈ File Structure: ``` py/ βββ api_controller.py # REST API endpoints βββ fine_tune_sentiment.py # Fine-tuning script βββ pages/ βββ __init__.py βββ single_analysis.py # π Single text analysis βββ batch_analysis.py # π Batch processing βββ model_info.py # βΉοΈ Model information βββ api_endpoints.py # π API documentation ``` ## π€ Model Management: - Always uses vietnamese_sentiment_finetuned model - Automatic fine-tuning if model doesn't exist - β¦b8ae42e