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
-
π Add comprehensive Hugging Face Spaces deployment guideβ
- Step-by-step deployment instructions - Hardware recommendations (CPU vs GPU) - API usage examples - Troubleshooting guide - Customization options - Success indicators Updated .gitignore to include important documentation files. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>ed82e70 -
π 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 -
update md
4fc5703 -
π§ Simplify app.py to resolve JavaScript errorsβ
- Remove complex memory management that was causing batch processing issues - Simplify sentiment analysis functions to return plain text output - Remove problematic BarPlot and complex data structures - Focus on core functionality: text input β sentiment analysis β markdown output - Ensure all Gradio components are properly connected and functional - Maintain memory cleanup and basic error handling This should resolve the persistent JavaScript addEventListener errors. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>4d616d3 -
π§ Fix JavaScript addEventListener error by removing problematic BarPlotβ
Problem: Svelte component error "can't access property 'addEventListener', y is undefined" Solution: - Remove problematic gradio.BarPlot component causing JavaScript errors - Simplify interface to use text-based confidence display only - Remove pandas dependency that was causing conflicts - Update event handlers to remove BarPlot references - Maintain all core functionality while fixing JavaScript errors Changes: - Removed gradio.BarPlot component completely - Simplified analyze_sentiment function to return text only - Updated clear_inputs function to remove BarPlot handling - Fixed button event handlers to work without plot component - Removed pandas import (no longer needed) π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>ce497c4 -
π§ Fix BarPlot DataFrame format errorβ
Problem: gradio.BarPlot was failing with DataFrame format issue Solution: - Convert DataFrame to list of lists format for better compatibility - Remove pandas DataFrame dependency from plot data - Use simpler data structure that works with gradio.BarPlot - Maintain x/y axis configuration for proper display Changes: - Updated analyze_sentiment function to use list format - Fixed data structure: [[Negative, 0.1], [Neutral, 0.7], [Positive, 0.2]] - Preserved all functionality while fixing plot display - Maintained x=sentiment, y=confidence axis labels π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>23c0426 -
π§ Fix button interaction issue in Gradio appβ
Problem: Buttons were not clickable due to scoping issues Solution: - Moved event handler functions outside of interface creation scope - Added global app_instance variable for proper state management - Simplified function structure to ensure accessibility - Fixed JavaScript event binding issues Changes: - Redefined all button event handlers as global functions - Used global app_instance for state management - Maintained all functionality while fixing interaction - Added error handling for uninitialized app state π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>d3bc543 -
π Add LaTeX paper and update gitignore for PDF folderβ
- Add paper.tex from pdf folder for LaTeX documentation - Update .gitignore to exclude all PDF compilation artifacts - Allow only paper.tex while excluding .aux, .log, .pdf, etc. - Prepare for GitHub repository push π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>b29c064 -
π§ Fix Gradio warnings and optimize for Spaces deploymentβ
- Update Gradio to latest version (4.44.1) to remove version warning - Set share=False as it's not supported on Hugging Face Spaces - Clean up launch configuration for production deployment π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>3321f40 -
π§ Fix Hugging Face Space configuration - Move files to rootβ
- Move README.md with proper YAML config to root directory - Move app.py and requirements.txt to root for Spaces deployment - Ensure all required files are in repository root - Fix missing configuration error π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>96462ff -
π§ Fix README configuration for Hugging Face Spacesβ
- Simplified YAML front matter to core required fields - Removed complex configuration that was causing errors - Maintained all documentation and features - Space should now load properly π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>ab92e28 -
π Merge remote changes with Vietnamese Sentiment Analysis deploymentβ
Resolved merge conflicts: - Kept optimized .gitattributes for deployment - Kept comprehensive README.md for Space Features ready: - Real-time Vietnamese sentiment analysis - Memory-optimized batch processing - Direct Hugging Face Hub model loading - Interactive confidence visualization - Complete documentation and user guide π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>f0f6b35 -
initial commit
Verified signaturee427056 -
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