基于深度学习的DGA恶意域名检测
test variable
fe446a2
raw
history blame
694 Bytes
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse
import os
from transformers import pipeline
varibale = os.getenv('test_variable')
secret = os.getenv('test_secret')
app = FastAPI()
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
@app.get("/infer_t5")
def t5(input):
output = pipe_flan(input)
# return {"output": output[0]["generated_text"]}
return {"output": str(varibale)+str(secret)}
app.mount("/", StaticFiles(directory="static", html=True), name="static")
@app.get("/")
def index() -> FileResponse:
return FileResponse(path="/app/static/index.html", media_type="text/html")