Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,16 +19,9 @@ import inspect
|
|
| 19 |
import logging
|
| 20 |
import shutil
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
# Set up basic configuration for logging
|
| 29 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 30 |
|
| 31 |
-
|
| 32 |
# Environment variables and configurations
|
| 33 |
huggingface_token = os.environ.get("HUGGINGFACE_TOKEN")
|
| 34 |
llama_cloud_api_key = os.environ.get("LLAMA_CLOUD_API_KEY")
|
|
@@ -44,9 +37,6 @@ MODELS = [
|
|
| 44 |
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
| 45 |
"@cf/meta/llama-3.1-8b-instruct",
|
| 46 |
"mistralai/Mistral-Nemo-Instruct-2407"
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
]
|
| 51 |
|
| 52 |
# Initialize LlamaParse
|
|
@@ -525,10 +515,6 @@ After writing the document, please provide a list of sources used in your respon
|
|
| 525 |
main_content += chunk
|
| 526 |
yield main_content, "" # Yield partial main content without sources
|
| 527 |
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
INSTRUCTION_PROMPTS = {
|
| 533 |
"Asset Managers": "Summarize the key financial metrics, assets under management, and performance highlights for this asset management company.",
|
| 534 |
"Consumer Finance Companies": "Provide a summary of the company's loan portfolio, interest income, credit quality, and key operational metrics.",
|
|
@@ -612,10 +598,6 @@ def vote(data: gr.LikeData):
|
|
| 612 |
else:
|
| 613 |
print(f"You downvoted this response: {data.value}")
|
| 614 |
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
css = """
|
| 620 |
/* Fine-tune chatbox size */
|
| 621 |
}
|
|
@@ -628,30 +610,6 @@ def display_documents():
|
|
| 628 |
choices=[doc["name"] for doc in uploaded_documents],
|
| 629 |
value=[doc["name"] for doc in uploaded_documents if doc["selected"]],
|
| 630 |
label="Select documents to query or delete"
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
)
|
| 656 |
|
| 657 |
def initial_conversation():
|
|
|
|
| 19 |
import logging
|
| 20 |
import shutil
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Set up basic configuration for logging
|
| 23 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 24 |
|
|
|
|
| 25 |
# Environment variables and configurations
|
| 26 |
huggingface_token = os.environ.get("HUGGINGFACE_TOKEN")
|
| 27 |
llama_cloud_api_key = os.environ.get("LLAMA_CLOUD_API_KEY")
|
|
|
|
| 37 |
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
| 38 |
"@cf/meta/llama-3.1-8b-instruct",
|
| 39 |
"mistralai/Mistral-Nemo-Instruct-2407"
|
|
|
|
|
|
|
|
|
|
| 40 |
]
|
| 41 |
|
| 42 |
# Initialize LlamaParse
|
|
|
|
| 515 |
main_content += chunk
|
| 516 |
yield main_content, "" # Yield partial main content without sources
|
| 517 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 518 |
INSTRUCTION_PROMPTS = {
|
| 519 |
"Asset Managers": "Summarize the key financial metrics, assets under management, and performance highlights for this asset management company.",
|
| 520 |
"Consumer Finance Companies": "Provide a summary of the company's loan portfolio, interest income, credit quality, and key operational metrics.",
|
|
|
|
| 598 |
else:
|
| 599 |
print(f"You downvoted this response: {data.value}")
|
| 600 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 601 |
css = """
|
| 602 |
/* Fine-tune chatbox size */
|
| 603 |
}
|
|
|
|
| 610 |
choices=[doc["name"] for doc in uploaded_documents],
|
| 611 |
value=[doc["name"] for doc in uploaded_documents if doc["selected"]],
|
| 612 |
label="Select documents to query or delete"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 613 |
)
|
| 614 |
|
| 615 |
def initial_conversation():
|