Skip to content

Commit

Permalink
debug df
Browse files Browse the repository at this point in the history
  • Loading branch information
mukulpatnaik committed Feb 6, 2023
1 parent 2eba69d commit 0c7d593
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def process_pdf():
paper_text = chatbot.parse_paper(pdf)
df = chatbot.paper_df(paper_text)
df = chatbot.calculate_embeddings(df)
print(df.head(5))
# save dataframe to csv at static/df.csv
df.to_csv('static/df.csv')
print("Done processing pdf")
Expand All @@ -170,6 +171,7 @@ def download_pdf():
paper_text = chatbot.parse_paper(pdf)
df = chatbot.paper_df(paper_text)
df = chatbot.calculate_embeddings(df)
print(df.head(5))
df.to_csv('static/df.csv')
print("Done processing pdf")
return "PDF file processed and embeddings calculated"
Expand All @@ -180,6 +182,7 @@ def reply():
query = request.json['query']
query = str(query)
df = pd.read_csv('static/df.csv')
print(df.head(5))
prompt = chatbot.create_prompt(df, query)
response = chatbot.gpt(prompt)
print(response)
Expand Down

0 comments on commit 0c7d593

Please sign in to comment.