Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,11 @@
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
| 2 |
|
| 3 |
app = FastAPI()
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
@app.get("/")
|
| 6 |
async def root():
|
| 7 |
return {"message": "Hello World"}
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
app = FastAPI()
|
| 5 |
|
| 6 |
+
# Initialize the text generation pipeline
|
| 7 |
+
pipe = pipeline("text2text-generation", model="google/flan-t5-small")
|
| 8 |
+
|
| 9 |
@app.get("/")
|
| 10 |
async def root():
|
| 11 |
return {"message": "Hello World"}
|