Sentence Similarity
sentence-transformers
Safetensors
feature-extraction
dense
Generated from Trainer
dataset_size:5749
loss:CosineSimilarityLoss
Eval Results (legacy)
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 tests/test_function_calling.py from spartan8806/atles: direct link, hf CLI and curl.
- Browser
- Download file 3.82 kB
-
https://huggingface.co/spartan8806/atles/resolve/main/tests/test_function_calling.py
- Command line
-
hf download hf://spartan8806/atles/tests/test_function_calling.py
-
curl -L -o test_function_calling.py https://huggingface.co/spartan8806/atles/resolve/main/tests/test_function_calling.py
3.82 kB
| #!/usr/bin/env python3 | |
| """ | |
| Test script for improved Ollama function calling | |
| """ | |
| import sys | |
| import os | |
| from pathlib import Path | |
| # Add the atles directory to the Python path | |
| sys.path.insert(0, str(Path(__file__).parent / 'atles')) | |
| def test_function_calling(): | |
| """Test the improved function calling capabilities.""" | |
| print("π§ͺ Testing Improved Ollama Function Calling...") | |
| print("=" * 60) | |
| try: | |
| from atles.ollama_client_enhanced import OllamaFunctionCaller | |
| # Create the enhanced client | |
| print("π± Creating Enhanced Ollama Client...") | |
| client = OllamaFunctionCaller() | |
| # Check availability | |
| print("π Checking Ollama availability...") | |
| if not client.is_available(): | |
| print("β Ollama is not running. Please start Ollama with: ollama serve") | |
| return | |
| print("β Ollama is available!") | |
| # Show available functions | |
| print("\nπ§ Available Functions:") | |
| schema = client.get_function_schema() | |
| for func in schema["functions"]: | |
| print(f" β’ {func['name']}: {func['description']}") | |
| # Test function execution directly | |
| print("\nπ§ͺ Testing Direct Function Execution...") | |
| # Test search_code function | |
| print("π Testing search_code function...") | |
| try: | |
| result = client.search_code_datasets("python flask", "python", "github_code") | |
| print(f" β Found {len(result)} code examples") | |
| if result: | |
| first_result = result[0] | |
| print(f" - Example: {first_result.get('title', 'No title')}") | |
| except Exception as e: | |
| print(f" β search_code failed: {e}") | |
| # Test system info function | |
| print("\nπ» Testing get_system_info function...") | |
| try: | |
| info = client.get_system_info() | |
| print(f" β Platform: {info.get('platform', 'Unknown')}") | |
| print(f" β Python: {info.get('python_version', 'Unknown')}") | |
| except Exception as e: | |
| print(f" β get_system_info failed: {e}") | |
| # Test file listing function | |
| print("\nπ Testing list_files function...") | |
| try: | |
| result = client.list_files(".", "*.py") | |
| print(f" β Found {len(result)} Python files") | |
| for file in result[:3]: # Show first 3 | |
| print(f" - {file}") | |
| except Exception as e: | |
| print(f" β list_files failed: {e}") | |
| # Test function call handling with different formats | |
| print("\nπ Testing Function Call Handling...") | |
| # Test 1: Standard FUNCTION_CALL format | |
| test_response1 = "FUNCTION_CALL:get_system_info:{}" | |
| print(f" Testing format 1: {test_response1}") | |
| result1 = client.handle_function_call(test_response1) | |
| print(f" Result: {result1[:100]}...") | |
| # Test 2: Alternative format | |
| test_response2 = "get_system_info:{}" | |
| print(f" Testing format 2: {test_response2}") | |
| result2 = client.handle_function_call(test_response2) | |
| print(f" Result: {result2[:100]}...") | |
| # Test 3: Search code format | |
| test_response3 = 'search_code:{"query": "python flask", "language": "python"}' | |
| print(f" Testing format 3: {test_response3}") | |
| result3 = client.handle_function_call(test_response3) | |
| print(f" Result: {result3[:100]}...") | |
| # Close client | |
| client.close() | |
| print("\nβ Function calling test completed!") | |
| except Exception as e: | |
| print(f"β Test failed: {e}") | |
| import traceback | |
| traceback.print_exc() | |
| if __name__ == "__main__": | |
| test_function_calling() | |