Update app.py
Browse files583 unmodified lines5845855865875885895904 unmodified lines595596597598599600601583 unmodified lineselse:logging.info("Using Hugging Face API")# Use Hugging Face APIprompt = [{"role": "system", "content": "You are a helpful assistant with access to context from PDF documents."},{"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}'"}]4 unmodified linesfor i in range(num_calls):logging.info(f"API call {i+1}/{num_calls}")for message in client.chat_completion(messages=[{"role": "user", "content": prompt}],max_tokens=20000,temperature=temperature,stream=True,583 unmodified lines5845855865875885895904 unmodified lines595596597598599600601583 unmodified lineselse:logging.info("Using Hugging Face API")# Use Hugging Face APImessages = [{"role": "system", "content": "You are a helpful assistant with access to context from PDF documents."},{"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}'"}]4 unmodified linesfor i in range(num_calls):logging.info(f"API call {i+1}/{num_calls}")for message in client.chat_completion(messages=messages,max_tokens=20000,temperature=temperature,stream=True,
app.py+2-2