Update app.py
Browse files
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 =
|
| 588 |
-
{
|
| 589 |
-
|
|
|
|
| 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 |
|