Shreyas094 commited on
Commit
5db53b7
1 Parent(s): 218c9a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -584,7 +584,7 @@ def get_response_from_pdf(query, model, selected_docs, num_calls=3, temperature=
584
  else:
585
  logging.info("Using Hugging Face API")
586
  # Use Hugging Face API
587
- prompt = [
588
  {"role": "system", "content": "You are a helpful assistant with access to context from PDF documents."},
589
  {"role": "user", "content": f"Using the following context from the PDF documents:\n{context_str}\n\nWrite a detailed and complete response that answers the following user question: '{query}'"}
590
  ]
@@ -595,7 +595,7 @@ def get_response_from_pdf(query, model, selected_docs, num_calls=3, temperature=
595
  for i in range(num_calls):
596
  logging.info(f"API call {i+1}/{num_calls}")
597
  for message in client.chat_completion(
598
- messages=[{"role": "user", "content": prompt}],
599
  max_tokens=20000,
600
  temperature=temperature,
601
  stream=True,
 
584
  else:
585
  logging.info("Using Hugging Face API")
586
  # Use Hugging Face API
587
+ messages = [
588
  {"role": "system", "content": "You are a helpful assistant with access to context from PDF documents."},
589
  {"role": "user", "content": f"Using the following context from the PDF documents:\n{context_str}\n\nWrite a detailed and complete response that answers the following user question: '{query}'"}
590
  ]
 
595
  for i in range(num_calls):
596
  logging.info(f"API call {i+1}/{num_calls}")
597
  for message in client.chat_completion(
598
+ messages=messages,
599
  max_tokens=20000,
600
  temperature=temperature,
601
  stream=True,