Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,18 +1,9 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
-
# Use a pipeline as a high-level helper
|
| 3 |
-
from transformers import pipeline
|
| 4 |
-
|
| 5 |
-
pipe = pipeline("text2text-generation", model="google/flan-t5-base")
|
| 6 |
|
|
|
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
-
|
| 10 |
-
@app.get(
|
| 11 |
-
def
|
| 12 |
-
return {"
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
@app.get('/ask')
|
| 16 |
-
def ask(prompt: str):
|
| 17 |
-
result = pipe(prompt)
|
| 18 |
-
return result[0]
|
|
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
# Create a FastAPI app instance
|
| 4 |
app = FastAPI()
|
| 5 |
|
| 6 |
+
# Define the root endpoint
|
| 7 |
+
@app.get("/")
|
| 8 |
+
def read_root():
|
| 9 |
+
return {"message": "Hello World"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|