Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

app.py 449 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
  1. from fastapi import FastAPI
  2. from inference import TSPredictor
  3. app = FastAPI(title="MLOps Basics App-S2")
  4. predictor = TSPredictor("./models/1/TSModel.hdf5","./models/1/vectorize_layer")
  5. @app.get("/")
  6. async def home():
  7. return "<h2>This is a sample NLP Project (sentiment analysis)</h2>"
  8. @app.get("/predict")
  9. async def get_prediction(text: str):
  10. processed_text = predictor.preprocess(raw_text = text)
  11. return predictor.infer(processed_text)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...