Yash Sachdeva commited on
Commit
3dd4624
·
1 Parent(s): a24d5ec
Files changed (1) hide show
  1. question_paper.py +3 -5
question_paper.py CHANGED
@@ -30,11 +30,9 @@ def llama(input):
30
 
31
  # tresponse = TOKENIZER.decode(tokens[0], skip_special_tokens=False)
32
  # print(tresponse)
33
- outputs = generator(input, max_length=100)
34
- text = ""
35
- for o in outputs:
36
- text = text + ' ' + o["generated_text"]
37
- response_message = {"message": text}
38
  json_response = jsonable_encoder(response_message)
39
  return JSONResponse(content=json_response)
40
 
 
30
 
31
  # tresponse = TOKENIZER.decode(tokens[0], skip_special_tokens=False)
32
  # print(tresponse)
33
+ output = generator(input, max_length=100)
34
+
35
+ response_message = {"message": output["generated_text"]}
 
 
36
  json_response = jsonable_encoder(response_message)
37
  return JSONResponse(content=json_response)
38