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
- Host: GitHub
- URL: https://github.com/rggh/fictional-pancake
- Owner: RGGH
- Created: 2023-03-26T17:13:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-26T20:35:12.000Z (over 3 years ago)
- Last Synced: 2025-03-28T01:55:30.606Z (over 1 year ago)
- Topics: fastapi, ml, python
- Language: HTML
- Homepage: https://redandgreen.co.uk
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# 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
---