Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,20 +2,13 @@ from fastapi import FastAPI
|
|
2 |
from transformers import pipeline
|
3 |
from huggingface_hub import login
|
4 |
|
5 |
-
huggingface-cli login
|
6 |
-
|
7 |
|
8 |
## create a new FASTAPI app instance
|
9 |
app=FastAPI()
|
10 |
|
11 |
-
import os
|
12 |
-
|
13 |
-
api_key = os.getenv("HF_API_KEY")
|
14 |
-
login(token=api_key)
|
15 |
-
|
16 |
|
17 |
# Initialize the text generation pipeline
|
18 |
-
pipe = pipeline("text-generation", model="
|
19 |
|
20 |
|
21 |
@app.get("/")
|
|
|
2 |
from transformers import pipeline
|
3 |
from huggingface_hub import login
|
4 |
|
|
|
|
|
5 |
|
6 |
## create a new FASTAPI app instance
|
7 |
app=FastAPI()
|
8 |
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
# Initialize the text generation pipeline
|
11 |
+
pipe = pipeline("text-generation", model="google/flan-t5-large")
|
12 |
|
13 |
|
14 |
@app.get("/")
|