Spaces:
Paused
Paused
Shreyas094
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ def count_tokens(text):
|
|
14 |
return len(tokenizer.encode(text))
|
15 |
def summarize_text(text, instructions, agent_name):
|
16 |
print(f"{agent_name}: Starting summarization")
|
17 |
-
API_URL = "https://api-inference.huggingface.co/models/
|
18 |
headers = {"Authorization": f"Bearer {HUGGINGFACE_TOKEN}"}
|
19 |
payload = {
|
20 |
"inputs": f"{instructions}\n\nText to summarize:\n{text}",
|
@@ -45,7 +45,7 @@ def process_pdf(pdf_file, chunk_instructions, window_instructions, final_instruc
|
|
45 |
# Concatenate Agent 1 summaries
|
46 |
concatenated_summary = "\n\n".join(agent1_summaries)
|
47 |
print(f"Concatenated Agent 1 summaries (length: {len(concatenated_summary)})")
|
48 |
-
print(f"Concatenated Summary:{concatenated_summary}")
|
49 |
# Sliding window approach
|
50 |
window_size = 3500 # in tokens
|
51 |
step_size = 3000 # overlap of 500 tokens
|
|
|
14 |
return len(tokenizer.encode(text))
|
15 |
def summarize_text(text, instructions, agent_name):
|
16 |
print(f"{agent_name}: Starting summarization")
|
17 |
+
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x22B-Instruct-v0.1"
|
18 |
headers = {"Authorization": f"Bearer {HUGGINGFACE_TOKEN}"}
|
19 |
payload = {
|
20 |
"inputs": f"{instructions}\n\nText to summarize:\n{text}",
|
|
|
45 |
# Concatenate Agent 1 summaries
|
46 |
concatenated_summary = "\n\n".join(agent1_summaries)
|
47 |
print(f"Concatenated Agent 1 summaries (length: {len(concatenated_summary)})")
|
48 |
+
print(f"Concatenated Summary:{concatenated_summary}")
|
49 |
# Sliding window approach
|
50 |
window_size = 3500 # in tokens
|
51 |
step_size = 3000 # overlap of 500 tokens
|