Spaces:
Sleeping
Sleeping
Download python_backend/src/CodeRunAndModelTrain/pipelines/CodeRunPipeline.py from VashuTheGreat2/ML-Learner: direct link, hf CLI and curl.
- Browser
- Download file 720 Bytes
-
https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/src/CodeRunAndModelTrain/pipelines/CodeRunPipeline.py
- Command line
-
hf download hf://spaces/VashuTheGreat2/ML-Learner/python_backend/src/CodeRunAndModelTrain/pipelines/CodeRunPipeline.py
-
curl -L -o CodeRunPipeline.py https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/src/CodeRunAndModelTrain/pipelines/CodeRunPipeline.py
720 Bytes
| from src.CodeRunAndModelTrain.components.code_runner import CodeRunner | |
| from src.CodeRunAndModelTrain.models.code_run_models import Submission | |
| from src.CodeRunAndModelTrain.utils.Abstract import Pipeline | |
| from utils.asyncHandler import asyncHandler | |
| import logging | |
| import sys | |
| class CodeRunPipeline(Pipeline): | |
| def __init__(self): | |
| super().__init__() | |
| self.code_runner = CodeRunner() | |
| async def initiate(self, sub: Submission): | |
| logging.info("Entered in the initiate CodeRunPipeline method") | |
| result = await self.code_runner.run_code(sub) | |
| logging.info("Code execution completed") | |
| logging.info("Exiting from CodeRunPipeline method") | |
| return result | |