scott12355 commited on
Commit
9ffdd96
·
verified ·
1 Parent(s): 10d5549

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -16
app.py CHANGED
@@ -1,20 +1,8 @@
1
  from fastapi import FastAPI
2
- from transformers import pipeline
3
 
 
4
 
5
- # NOTE - we configure docs_url to serve the interactive Docs at the root path
6
- # of the app. This way, we can use the docs as a landing page for the app on Spaces.
7
- app = FastAPI(docs_url="/")
8
 
9
- pipe = pipeline("text2text-generation", model="google/flan-t5-small")
10
-
11
-
12
- @app.get("/generate")
13
- def generate(text: str):
14
- """
15
- Using the text2text-generation pipeline from `transformers`, generate text
16
- from the given input text. The model used is `google/flan-t5-small`, which
17
- can be found [here](https://huggingface.co/google/flan-t5-small).
18
- """
19
- output = pipe(text)
20
- return {"output": output[0]["generated_text"]}
 
1
  from fastapi import FastAPI
 
2
 
3
+ app = FastAPI()
4
 
 
 
 
5
 
6
+ @app.get("/")
7
+ async def root():
8
+ return {"message": "Hello World"}