Spaces:
Sleeping
Sleeping
Update Website Powerful Project.py
Browse files
Website Powerful Project.py
CHANGED
|
@@ -83,7 +83,7 @@ def summary_generator(link):
|
|
| 83 |
embeddings = HuggingFaceEmbeddings(model_name='sentence-transformers/all-mpnet-base-v2')
|
| 84 |
db = Chroma.from_texts(chunks,embeddings)
|
| 85 |
if (len(ref_cont.split(" ")) * 1.4) >= 12000:
|
| 86 |
-
ref_cont = "".join(ref_cont.split(" ")[:5000])
|
| 87 |
res = invoke_llm(f"Please summarize the following text into 2-3 lines. Give an overview of what it's about. Ignore all the unnessessary website content, focus only on text. Just generate the summary and nothing else, not even here's the summary and all. Here's the text: '{ref_cont}'")
|
| 88 |
yield gr.update(visible=False), gr.update(visible=False), gr.update(visible=True), res, gr.update(visible=False), db
|
| 89 |
else:
|
|
|
|
| 83 |
embeddings = HuggingFaceEmbeddings(model_name='sentence-transformers/all-mpnet-base-v2')
|
| 84 |
db = Chroma.from_texts(chunks,embeddings)
|
| 85 |
if (len(ref_cont.split(" ")) * 1.4) >= 12000:
|
| 86 |
+
ref_cont = " ".join(ref_cont.split(" ")[:5000])
|
| 87 |
res = invoke_llm(f"Please summarize the following text into 2-3 lines. Give an overview of what it's about. Ignore all the unnessessary website content, focus only on text. Just generate the summary and nothing else, not even here's the summary and all. Here's the text: '{ref_cont}'")
|
| 88 |
yield gr.update(visible=False), gr.update(visible=False), gr.update(visible=True), res, gr.update(visible=False), db
|
| 89 |
else:
|