sarthak501 commited on
Commit
5d54b97
·
verified ·
1 Parent(s): 8e595ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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
- return {"story": tokenizer.decode(outputs[0], skip_special_tokens=True)}
 
 
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}