Skip to content

Commit

Permalink
Bug Fixed: Query Stuck
Browse files Browse the repository at this point in the history
In the main file, the query is stuck on the previous feed information.
  • Loading branch information
AnamolZ committed Aug 2, 2024
1 parent 8a9a240 commit 2ff6c52
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def transcribe_video(self, filename):

@app.post("/process")
async def process_request(request: ProcessRequest):
os.remove("video.m4a")
action = request.action
input_text = request.input

Expand All @@ -126,13 +127,11 @@ async def process_request(request: ProcessRequest):

genaiQA = GenaiQA(modelName, genaiApiKey)
summary_text = genaiQA.getSummary(transcript_text)
os.remove("video.m4a")
return JSONResponse(content={"status": "success", "summary": summary_text})

elif action == "ask":
genaiQA = GenaiQA(modelName, genaiApiKey)
answer_text = genaiQA.getAnswer(input_text, [input_text])
os.remove("video.m4a")
return JSONResponse(content={"status": "success", "answer": answer_text})

else:
Expand Down

0 comments on commit 2ff6c52

Please sign in to comment.