wyyadd commited on
Commit
a0642c1
1 Parent(s): cc38132

Update app.py

Browse files

Feat: use gpt-4o-mini

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -56,7 +56,7 @@ def save_uploaded_file(uploaded_file):
56
 
57
  def summarize_pdf(pdf_file_path, num_clusters=10):
58
  embeddings_model = OpenAIEmbeddings(model="text-embedding-3-small", api_key=openai_api_key)
59
- llm = ChatOpenAI(model="gpt-3.5-turbo", api_key=openai_api_key, temperature=0.3)
60
  prompt = ChatPromptTemplate.from_template(
61
  """Could you please provide a concise and comprehensive summary of the given Contexts?
62
  The summary should capture the main points and key details of the text while conveying the author's intended meaning accurately.
@@ -89,7 +89,7 @@ def summarize_pdf(pdf_file_path, num_clusters=10):
89
 
90
  def qa_pdf(pdf_file_path, query, num_clusters=5, similarity_threshold=0.6):
91
  embeddings_model = OpenAIEmbeddings(model="text-embedding-3-small", api_key=openai_api_key)
92
- llm = ChatOpenAI(model="gpt-3.5-turbo", api_key=openai_api_key, temperature=0.3)
93
  prompt = ChatPromptTemplate.from_template(
94
  """Please provide a detailed and accurate answer to the given question based on the provided contexts.
95
  Ensure that the answer is comprehensive and directly addresses the query.
 
56
 
57
  def summarize_pdf(pdf_file_path, num_clusters=10):
58
  embeddings_model = OpenAIEmbeddings(model="text-embedding-3-small", api_key=openai_api_key)
59
+ llm = ChatOpenAI(model="gpt-4o-mini", api_key=openai_api_key, temperature=0.3)
60
  prompt = ChatPromptTemplate.from_template(
61
  """Could you please provide a concise and comprehensive summary of the given Contexts?
62
  The summary should capture the main points and key details of the text while conveying the author's intended meaning accurately.
 
89
 
90
  def qa_pdf(pdf_file_path, query, num_clusters=5, similarity_threshold=0.6):
91
  embeddings_model = OpenAIEmbeddings(model="text-embedding-3-small", api_key=openai_api_key)
92
+ llm = ChatOpenAI(model="gpt-4o-mini", api_key=openai_api_key, temperature=0.3)
93
  prompt = ChatPromptTemplate.from_template(
94
  """Please provide a detailed and accurate answer to the given question based on the provided contexts.
95
  Ensure that the answer is comprehensive and directly addresses the query.