kokluch commited on
Commit
3a2b389
·
1 Parent(s): 000642c

Add robot.txt

Browse files
Files changed (2) hide show
  1. app.py +5 -2
  2. robot.txt +2 -0
app.py CHANGED
@@ -1,5 +1,5 @@
1
  from fastapi import FastAPI
2
- from fastapi.responses import JSONResponse
3
  from pydantic import BaseModel
4
  from enum import Enum
5
  from transformers import pipeline
@@ -43,7 +43,6 @@ class OutputModel(BaseModel):
43
 
44
  pipe = pipeline(task="text-classification", model="mrm8488/bert-tiny-finetuned-sms-spam-detection")
45
 
46
-
47
  @app.get("/.well-known/apple-app-site-association", include_in_schema=False)
48
  def get_well_known_aasa():
49
  return JSONResponse(
@@ -58,6 +57,10 @@ def get_well_known_aasa():
58
  media_type="application/json"
59
  )
60
 
 
 
 
 
61
  @app.post("/predict")
62
  def predict(model: InputModel) -> OutputModel:
63
  text = model.query.message.text
 
1
  from fastapi import FastAPI
2
+ from fastapi.responses import JSONResponse, FileResponse
3
  from pydantic import BaseModel
4
  from enum import Enum
5
  from transformers import pipeline
 
43
 
44
  pipe = pipeline(task="text-classification", model="mrm8488/bert-tiny-finetuned-sms-spam-detection")
45
 
 
46
  @app.get("/.well-known/apple-app-site-association", include_in_schema=False)
47
  def get_well_known_aasa():
48
  return JSONResponse(
 
57
  media_type="application/json"
58
  )
59
 
60
+ @app.get("/robot.txt", include_in_schema=False)
61
+ def get_robot_txt():
62
+ return FileResponse("robot.txt")
63
+
64
  @app.post("/predict")
65
  def predict(model: InputModel) -> OutputModel:
66
  text = model.query.message.text
robot.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ User-agent: *
2
+ Disallow: /