Spaces:
Runtime error
Runtime error
Download main.py from GooooGLE/vulnerability_testing: direct link, hf CLI and curl.
- Browser
- Download file 909 Bytes
-
https://huggingface.co/spaces/GooooGLE/vulnerability_testing/resolve/main/main.py
- Command line
-
hf download hf://spaces/GooooGLE/vulnerability_testing/main.py
-
curl -L -o main.py https://huggingface.co/spaces/GooooGLE/vulnerability_testing/resolve/main/main.py
909 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') | |
| token_model = os.getenv('HF_Token') | |
| app = FastAPI() | |
| # pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small") | |
| # pipe_flan = pipeline("text2text-generation", model="GooooGLE/testVulModel",token = token_model) | |
| pipe_flan = pipeline("text2text-generation", model="GooooGLE/testVulModel") | |
| 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") | |
| def index() -> FileResponse: | |
| return FileResponse(path="/app/static/index.html", media_type="text/html") |