An open API service indexing awesome lists of open source software.

https://github.com/rggh/fictional-pancake

FastAPI + ML
https://github.com/rggh/fictional-pancake

fastapi ml python

Last synced: about 1 month ago
JSON representation

FastAPI + ML

Awesome Lists containing this project

README

          

![workflow](https://github.com/RGGH/fictional-pancake/actions/workflows/main.yml/badge.svg)

# FastAPI + ML Demo | work-in-progress

### html, javascript, FastAPI

#remember to add code in fastapi to allow CORS

import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from sklearn.neural_network import MLPRegressor
import numpy as np

app = FastAPI()

output = {}

origins = [
"http://redandgreen.co.uk"
]

app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)

---

https://www.stackhawk.com/blog/configuring-cors-in-fastapi/
-----------------------------------------------------------

Try the code here : http://redandgreen.co.uk/pancake/demo.html

---