Update app.py
#1
by wyyadd - opened
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-
|
| 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-
|
| 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.
|