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 -
π Update fine-tuning configuration to match 5CD-AI/Vietnamese-Sentiment-visobertβ
Based on information from the official Hugging Face model page: ## Fine-Tuning Configuration Updates: - **Epochs**: Changed from 3 to 5 (matching original model training) - **Max Sequence Length**: Changed from 512 to 256 (matching original) - **Optimizer**: Explicitly set to adamw_torch with correct betas/epsilon - **Gradient Accumulation**: Set to 1 step (matching original) - **Training Arguments**: Added original model specific parameters ## Documentation Updates: - **Model Details**: Updated with accurate architecture info (XLM-RoBERTa) - **Base Model**: Added pre-trained base (visobert-14gb-corpus) details - **Parameters**: 97.6M parameters, safetensors format - **Performance**: Up to 99.64% F1 score, outperforms phobert-base - **Dataset Information**: Comprehensive list of 120K training datasets - **Label Mapping**: Corrected to 0=Negative, 1=Positive, 2=Neutral - **Training Datasets**: Added all 11 datasets used in original training ## Code Updates: - Updated default parameteβ¦bc9750a -
Implement Vietnamese Sentiment Analysis: Fine-tuning, Gradio Interface, and Model Testingβ
- Added `fine_tune_sentiment.py` for fine-tuning a sentiment analysis model on Vietnamese text. - Created `gradio_app.py` to provide an interactive web interface for real-time sentiment analysis. - Developed `test_model.py` for evaluating the fine-tuned model with custom texts, batch processing, and comparison with the original model. - Included memory management features in the Gradio app to optimize performance. - Implemented detailed logging and error handling throughout the codebase. - Added visualization capabilities for training history and confusion matrix.0210351