Spaces:
Runtime error
Runtime error
File size: 581 Bytes
99731e4 1cf9af5 cc0a55b 99731e4 0f37cd0 99731e4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
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) |