testeFlask / app.py
Herick1's picture
Update app.py
0f37cd0 verified
raw
history blame contribute delete
581 Bytes
from flask import Flask, request
from datasets import load_dataset
import os
token = os.getenv('hugging_token')
app = Flask(__name__)
@app.route('/', methods=["GET","POST"])
def main():
try:
# Carregando um dataset local
dataset = load_dataset("Herick1/datasetTest", data_files="Herick1/datasetTest/t.txt", use_auth_token=token)
if request.method == "GET":
return {"message":"Sem Dados..."}
else:
data_post = request.get_json()
except Exception as err:
return str(err)