Spaces:
Sleeping
Sleeping
| title: Textilindo AI Assistant | |
| emoji: 🤖 | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: docker | |
| sdk_version: "4.0.0" | |
| app_file: app.py | |
| pinned: false | |
| license: mit | |
| short_description: AI Assistant for Textilindo textile company | |
| # 🤖 Textilindo AI Assistant | |
| An intelligent AI assistant for Textilindo textile company with advanced training capabilities, built with FastAPI and Hugging Face Transformers. | |
| ## ✨ Features | |
| - **Intelligent Chat Interface**: Natural language conversations in Indonesian | |
| - **Company Knowledge**: Trained on Textilindo's specific information | |
| - **Model Training**: Train custom models with your data | |
| - **Fast Response**: Optimized for quick customer service | |
| - **Mobile Friendly**: Responsive web interface | |
| - **API Ready**: RESTful API for integration | |
| ## 🚀 Quick Start | |
| ### Chat Interface | |
| Visit the main page to start chatting with the AI assistant. Ask questions about: | |
| - Company location and hours | |
| - Product information | |
| - Ordering and shipping | |
| - Sample requests | |
| - Pricing and terms | |
| ### Training API | |
| #### Start Training | |
| ```bash | |
| curl -X POST "https://harismlnaslm-Textilindo-AI.hf.space/api/train/start" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "model_name": "distilgpt2", | |
| "dataset_path": "data/lora_dataset_20250910_145055.jsonl", | |
| "config_path": "configs/training_config.yaml", | |
| "max_samples": 10, | |
| "epochs": 1, | |
| "batch_size": 1, | |
| "learning_rate": 5e-5 | |
| }' | |
| ``` | |
| #### Check Training Status | |
| ```bash | |
| curl "https://harismlnaslm-Textilindo-AI.hf.space/api/train/status" | |
| ``` | |
| #### Test Trained Model | |
| ```bash | |
| curl -X POST "https://harismlnaslm-Textilindo-AI.hf.space/api/train/test" | |
| ``` | |
| #### Get Training Data Info | |
| ```bash | |
| curl "https://harismlnaslm-Textilindo-AI.hf.space/api/train/data" | |
| ``` | |
| #### Check GPU Availability | |
| ```bash | |
| curl "https://harismlnaslm-Textilindo-AI.hf.space/api/train/gpu" | |
| ``` | |
| ## 🛠️ Technical Details | |
| ### Architecture | |
| - **Framework**: FastAPI with Uvicorn | |
| - **AI Model**: Llama 3.1 8B Instruct (via Hugging Face) | |
| - **Training**: PyTorch with Transformers | |
| - **Language**: Indonesian (Bahasa Indonesia) | |
| - **Deployment**: Docker on Hugging Face Spaces | |
| ### API Endpoints | |
| #### Chat Endpoints | |
| - `GET /` - Main chat interface | |
| - `POST /chat` - Chat API endpoint | |
| - `GET /health` - Health check | |
| - `GET /info` - Application information | |
| #### Training Endpoints | |
| - `POST /api/train/start` - Start model training | |
| - `GET /api/train/status` - Check training progress | |
| - `GET /api/train/data` - Get training data information | |
| - `GET /api/train/gpu` - Check GPU availability | |
| - `POST /api/train/test` - Test trained model | |
| ### Environment Variables | |
| Set these in your space settings: | |
| ```bash | |
| # Required: Hugging Face API Key | |
| HUGGINGFACE_API_KEY=your_api_key_here | |
| # Optional: Model selection | |
| DEFAULT_MODEL=meta-llama/Llama-3.1-8B-Instruct | |
| ``` | |
| ## 📞 Support | |
| For technical issues: | |
| 1. Check the `/health` endpoint | |
| 2. Review space logs | |
| 3. Verify environment variables | |
| 4. Test with mock responses | |
| --- | |
| *Built with ❤️ for Textilindo customers* |