Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,13 @@ from transformers import pipeline
|
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
6 |
-
#
|
7 |
-
generator = pipeline(
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
@app.post("/gerar")
|
10 |
async def gerar_historia(req: Request):
|
|
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
6 |
+
# Corrigido com from_tf=True
|
7 |
+
generator = pipeline(
|
8 |
+
"text-generation",
|
9 |
+
model="pierreguillou/gpt2-small-portuguese",
|
10 |
+
max_length=300,
|
11 |
+
from_tf=True
|
12 |
+
)
|
13 |
|
14 |
@app.post("/gerar")
|
15 |
async def gerar_historia(req: Request):
|