Sentence Similarity
sentence-transformers
Safetensors
feature-extraction
dense
Generated from Trainer
dataset_size:5749
loss:CosineSimilarityLoss
Eval Results (legacy)
Run this model with HF Jobs
Run spartan8806/atles on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/spartan8806/atles. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/spartan8806/atles on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use spartan8806/atles with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use spartan8806/atles with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("spartan8806/atles") sentences = [ "Red sports car racing down track.", "A red sports car driving quickly on a track.", "Mali's Interim President Sworn Into Office", "Iran, world powers pledge new nuclear talks" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
|
Download docs/guides/REFACTORING_MIGRATION_GUIDE.md from spartan8806/atles: direct link, hf CLI and curl.
- Browser
- Download file 7.05 kB
-
https://huggingface.co/spartan8806/atles/resolve/main/docs/guides/REFACTORING_MIGRATION_GUIDE.md
- Command line
-
hf download hf://spartan8806/atles/docs/guides/REFACTORING_MIGRATION_GUIDE.md
-
curl -L -o REFACTORING_MIGRATION_GUIDE.md https://huggingface.co/spartan8806/atles/resolve/main/docs/guides/REFACTORING_MIGRATION_GUIDE.md
7.05 kB
| # π ATLES Refactoring Migration Guide | |
| ## Overview | |
| This guide helps migrate from the complex, duplicated constitutional client architecture to the new **Unified Constitutional Client** with clean, modular design. | |
| ## π¨ Why Refactoring Was Necessary | |
| ### Problems with Old Architecture: | |
| - β **Code Duplication**: Multiple bootstrap systems (`identity_bootstrap_system.py` vs `bootstrap_system.py`) | |
| - β **Complex Conditionals**: Excessive `hasattr()` checks and nested logic | |
| - β **Maintenance Burden**: Difficult to add new features or fix bugs | |
| - β **Inconsistent Patterns**: Different ways of handling the same functionality | |
| - β **Error-Prone**: Easy to introduce bugs when making changes | |
| ### Benefits of New Architecture: | |
| - β **Clean Separation**: Processors (generators) vs Filters (modifiers) | |
| - β **Modular Components**: Each component has single responsibility | |
| - β **Linear Pipeline**: Easy to understand processing flow | |
| - β **Graceful Degradation**: Components fail independently | |
| - β **Easy Testing**: Each component can be tested in isolation | |
| - β **Backward Compatible**: Existing code continues to work | |
| ## π Migration Steps | |
| ### Step 1: Update Imports | |
| **Old Code:** | |
| ```python | |
| from atles.constitutional_client import create_constitutional_client | |
| ``` | |
| **New Code:** | |
| ```python | |
| # Option 1: Use new unified client directly | |
| from atles.unified_constitutional_client import create_unified_constitutional_client | |
| # Option 2: Use backward compatibility (recommended for gradual migration) | |
| from atles.unified_constitutional_client import create_constitutional_client | |
| ``` | |
| ### Step 2: Update Client Creation | |
| **Old Code:** | |
| ```python | |
| # Complex initialization with multiple systems | |
| client = create_constitutional_client(base_client) | |
| # Had to worry about which systems were available | |
| ``` | |
| **New Code:** | |
| ```python | |
| # Simple, clean initialization | |
| client = create_unified_constitutional_client(base_client) | |
| # All systems auto-detected and initialized | |
| ``` | |
| ### Step 3: Update Usage Patterns | |
| **Old Code:** | |
| ```python | |
| # Had to check if systems were available | |
| if hasattr(client, 'bootstrap_system') and client.bootstrap_system: | |
| # Do something | |
| if hasattr(client, 'capability_grounding') and client.capability_grounding: | |
| # Do something else | |
| ``` | |
| **New Code:** | |
| ```python | |
| # Just use the client - it handles everything internally | |
| response = client.chat("Hello") | |
| # All systems are automatically applied if available | |
| ``` | |
| ## π Architecture Comparison | |
| ### Old Architecture (Complex): | |
| ``` | |
| ConstitutionalClient | |
| βββ Multiple bootstrap systems (duplicated) | |
| βββ Complex conditional logic | |
| βββ Nested hasattr() checks | |
| βββ Manual system coordination | |
| βββ Error-prone initialization | |
| ``` | |
| ### New Architecture (Clean): | |
| ``` | |
| UnifiedConstitutionalClient | |
| βββ Processors (Generate responses) | |
| β βββ BootstrapProcessor | |
| β βββ MemoryProcessor | |
| βββ Filters (Modify responses) | |
| β βββ CapabilityProcessor | |
| β βββ MathProcessor | |
| β βββ ContextProcessor | |
| βββ Linear pipeline with graceful degradation | |
| ``` | |
| ## π§ Component Details | |
| ### Processors (Response Generators) | |
| - **BootstrapProcessor**: Handles identity recognition and session management | |
| - **MemoryProcessor**: Provides memory-aware reasoning | |
| ### Filters (Response Modifiers) | |
| - **CapabilityProcessor**: Prevents capability hallucinations | |
| - **MathProcessor**: Verifies mathematical calculations | |
| - **ContextProcessor**: Maintains conversational coherence and rule compliance | |
| ### Processing Pipeline: | |
| ``` | |
| Input β Processors β Base Client β Filters β Output | |
| ``` | |
| ## π§ͺ Testing Your Migration | |
| ### Test 1: Basic Functionality | |
| ```python | |
| from atles.unified_constitutional_client import create_unified_constitutional_client | |
| client = create_unified_constitutional_client() | |
| response = client.chat("Hello, I am Conner") | |
| print(response) # Should recognize Conner properly | |
| ``` | |
| ### Test 2: Component Status | |
| ```python | |
| status = client.get_constitutional_status() | |
| print(f"Available processors: {status['available_processors']}") | |
| print(f"Available filters: {status['available_filters']}") | |
| ``` | |
| ### Test 3: Rule Compliance | |
| ```python | |
| client.chat("Please give me one-word replies only") | |
| response = client.chat("What's 2+2?") | |
| print(response) # Should be one word: "Four" | |
| ``` | |
| ## π Migration Checklist | |
| - [ ] **Update imports** to use unified client | |
| - [ ] **Remove hasattr() checks** - no longer needed | |
| - [ ] **Simplify initialization** - let the client handle it | |
| - [ ] **Test all functionality** - ensure everything still works | |
| - [ ] **Update documentation** - reflect new architecture | |
| - [ ] **Remove old files** - clean up deprecated code | |
| ## π Gradual Migration Strategy | |
| ### Phase 1: Backward Compatibility (Immediate) | |
| ```python | |
| # Just change the import - everything else stays the same | |
| from atles.unified_constitutional_client import create_constitutional_client | |
| ``` | |
| ### Phase 2: Adopt New Patterns (Recommended) | |
| ```python | |
| # Use the new unified client with cleaner patterns | |
| from atles.unified_constitutional_client import create_unified_constitutional_client | |
| client = create_unified_constitutional_client() | |
| ``` | |
| ### Phase 3: Clean Up (Final) | |
| - Remove old conditional checks | |
| - Update tests to use new architecture | |
| - Remove deprecated files | |
| ## π¨ Breaking Changes | |
| ### None! | |
| The refactoring maintains **100% backward compatibility**. Your existing code will continue to work without changes. | |
| ### Optional Improvements: | |
| - Remove unnecessary `hasattr()` checks | |
| - Simplify initialization code | |
| - Use cleaner error handling patterns | |
| ## π Troubleshooting | |
| ### Issue: "Module not found" errors | |
| **Solution**: Ensure all dependencies are properly installed and paths are correct. | |
| ### Issue: Components not initializing | |
| **Solution**: Check the logs - components gracefully degrade if dependencies are missing. | |
| ### Issue: Different behavior than before | |
| **Solution**: The new architecture should behave identically. If not, file a bug report. | |
| ## π Performance Benefits | |
| ### Old Architecture: | |
| - Multiple system initializations | |
| - Redundant checks and processing | |
| - Complex error handling paths | |
| ### New Architecture: | |
| - Single initialization per component type | |
| - Linear processing pipeline | |
| - Efficient error handling and graceful degradation | |
| ## π― Next Steps | |
| 1. **Test the migration** using the provided test script | |
| 2. **Update your imports** to use the unified client | |
| 3. **Gradually adopt** new patterns where beneficial | |
| 4. **Remove old code** once migration is complete | |
| 5. **Enjoy** the cleaner, more maintainable architecture! | |
| ## π Support | |
| If you encounter any issues during migration: | |
| 1. Check the test results to identify specific problems | |
| 2. Review the component status to see what's available | |
| 3. Use the backward compatibility mode as a fallback | |
| 4. The new architecture is designed to be more robust and easier to debug | |
| --- | |
| **The refactored architecture provides the same functionality with much cleaner, more maintainable code. Migration is safe and backward compatible!** π | |