Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,7 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
5 |
|
6 |
app = FastAPI()
|
7 |
app.add_middleware(
|
8 |
-
CORSMiddleware,
|
9 |
-
allow_origins=["*"], allow_credentials=False,
|
10 |
allow_methods=["*"], allow_headers=["*"]
|
11 |
)
|
12 |
|
@@ -30,4 +29,5 @@ async def generate_story(req: PromptRequest):
|
|
30 |
repetition_penalty=1.2,
|
31 |
do_sample=True
|
32 |
)
|
33 |
-
|
|
|
|
5 |
|
6 |
app = FastAPI()
|
7 |
app.add_middleware(
|
8 |
+
CORSMiddleware, allow_origins=["*"], allow_credentials=False,
|
|
|
9 |
allow_methods=["*"], allow_headers=["*"]
|
10 |
)
|
11 |
|
|
|
29 |
repetition_penalty=1.2,
|
30 |
do_sample=True
|
31 |
)
|
32 |
+
story = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
33 |
+
return {"story": story}
|