rcook commited on
Commit
4952a6e
·
verified ·
1 Parent(s): 5bb2f0c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ from datasets import load_dataset
3
+
4
+ app = FastAPI()
5
+
6
+ @app.get("/")
7
+ def greet_json():
8
+ # Example: Loading a dataset as part of the API
9
+ dataset = load_dataset("squad")
10
+ return {"Hello": "World!", "dataset_length": len(dataset["train"])}