Spaces:
Sleeping
Sleeping
Download python_backend/src/CodeRunAndModelTrain/tests/CodeRunPipeline_tests.py from VashuTheGreat2/ML-Learner: direct link, hf CLI and curl.
- Browser
- Download file 770 Bytes
-
https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/src/CodeRunAndModelTrain/tests/CodeRunPipeline_tests.py
- Command line
-
hf download hf://spaces/VashuTheGreat2/ML-Learner/python_backend/src/CodeRunAndModelTrain/tests/CodeRunPipeline_tests.py
-
curl -L -o CodeRunPipeline_tests.py https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/src/CodeRunAndModelTrain/tests/CodeRunPipeline_tests.py
770 Bytes
| import os | |
| import sys | |
| import asyncio | |
| import logging | |
| # Add root directory to sys.path | |
| sys.path.append(os.getcwd()) | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| from logger import * | |
| from src.CodeRunAndModelTrain.pipelines.CodeRunPipeline import CodeRunPipeline | |
| from src.CodeRunAndModelTrain.models.code_run_models import Submission | |
| async def main(): | |
| pipeline = CodeRunPipeline() | |
| # Using the default Submission model (addition function) | |
| sub = Submission() | |
| logging.info("Starting CodeRunPipeline test") | |
| res = await pipeline.initiate(sub) | |
| for r in res: | |
| logging.info(f"Input: {r['test_input']} | Result: {r['test_res']} | Expected: {r['expected_res']} | Pass: {r['pass']}") | |
| if __name__ == "__main__": | |
| asyncio.run(main()) | |