memofy commited on
Commit
17efda1
·
verified ·
1 Parent(s): f899c51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -3,8 +3,13 @@ from transformers import pipeline
3
 
4
  app = FastAPI()
5
 
6
- # Utilizando o modelo GPT-2 pequeno para português
7
- generator = pipeline("text-generation", model="pierreguillou/gpt2-small-portuguese", max_length=300)
 
 
 
 
 
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):