Spaces:
Running on Zero
Running on Zero
| import tempfile | |
| import unittest | |
| from pathlib import Path | |
| from zsgdp.config import load_config | |
| from zsgdp.profiling import profile_document | |
| from zsgdp.routing import route_document | |
| class RoutingTests(unittest.TestCase): | |
| def test_markdown_routes_to_text_parser(self): | |
| with tempfile.TemporaryDirectory() as tmp: | |
| path = Path(tmp) / "sample.md" | |
| path.write_text("# Hello\n\nWorld", encoding="utf-8") | |
| profile = profile_document(path) | |
| decisions = route_document(profile, load_config()) | |
| self.assertEqual(decisions[0].experts, ["text"]) | |
| self.assertEqual(decisions[0].metadata["gpu_models_target"], "zeroshotGPU") | |
| if __name__ == "__main__": | |
| unittest.main() | |