Spaces:
Sleeping
Sleeping
File size: 465 Bytes
6bb0951 4dd54a9 6bb0951 4dd54a9 df6fdec 8ca6dd8 64bc0cd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
from fastapi import FastAPI
from datasets import load_dataset
from transformers import AutoTokenizer
app = FastAPI()
@app.get("/")
def summarize():
# Example: Loading a dataset as part of the API
billsum = load_dataset("billsum", split="ca_test")
import pandas as pd
df = pd.read_csv("squad_sample_train.tsv", sep="\t")
# print(df.head()) # Debugging step
# return {"Hello": "World!", "dataset_length": len(billsum)}
return df.head()
|