rcook commited on
Commit
6bb0951
·
verified ·
1 Parent(s): 6fc9146

Update app.py

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