Shreyas094 commited on
Commit
218c9a4
1 Parent(s): 9b9a599

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -584,9 +584,10 @@ 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 = f"""Using the following context from the PDF documents:
588
- {context_str}
589
- Write a detailed and complete response that answers the following user question: '{query}'"""
 
590
 
591
  client = InferenceClient(model, token=huggingface_token)
592
 
 
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
+ ]
591
 
592
  client = InferenceClient(model, token=huggingface_token)
593