Spaces:
Runtime error
Runtime error
Download app.py from Ranajit1997/CodeReviewer: direct link, hf CLI and curl.
- Browser
- Download file 544 Bytes
-
https://huggingface.co/spaces/Ranajit1997/CodeReviewer/resolve/main/app.py
- Command line
-
hf download hf://spaces/Ranajit1997/CodeReviewer/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Ranajit1997/CodeReviewer/resolve/main/app.py
544 Bytes
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| from pipeline import CodeReviewerPipeline | |
| app = FastAPI(title="AI Code Reviewer") | |
| pipeline = CodeReviewerPipeline() | |
| class CodeRequest(BaseModel): | |
| code: str | |
| def review_code(request: CodeRequest): | |
| """ | |
| POST /review | |
| JSON payload: {"code": "python code string"} | |
| Returns: JSON review from pipeline | |
| """ | |
| result = pipeline(request.code) | |
| return result | |
| def root(): | |
| return {"message": "AI Code Reviewer API is running!"} | |