File size: 534 Bytes
5846481
 
 
 
430d9b4
9cb52f4
 
1307547
5846481
 
 
 
 
 
430d9b4
 
 
5846481
837bb05
5846481
 
 
430d9b4
6aebca7
5feeb45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from fastapi import FastAPI
from app import predict
import os
from huggingface_hub import login
from pydantic import BaseModel
import sys
 
sys.setrecursionlimit(10**5)

os.environ['HF_HOME'] = '/hug/cache/'
os.environ['TRANSFORMERS_CACHE'] = '/blabla/cache/'

app = FastAPI()

class Item(BaseModel):
    code: str

@app.get("/")
async def root():
 return {"Code Review Automation":"Version 1.0 'First Draft'"}

@app.post("/AutomateReview/")
async def predict(item: Item):
    result = await predict(item)
    return {"answer":result}