Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -12,6 +12,7 @@ from langchain_community.tools import DuckDuckGoSearchResults
|
|
| 12 |
from langchain_community.utilities import DuckDuckGoSearchAPIWrapper
|
| 13 |
|
| 14 |
|
|
|
|
| 15 |
API_URL0 = "https://api-inference.huggingface.co/models/sentence-transformers/multi-qa-MiniLM-L6-cos-v1"
|
| 16 |
API_URL1 = "https://api-inference.huggingface.co/models/sentence-transformers/all-mpnet-base-v2"
|
| 17 |
API_URL2 = "https://api-inference.huggingface.co/models/sentence-transformers/all-roberta-large-v1"
|
|
@@ -156,7 +157,7 @@ async def server_1():
|
|
| 156 |
# TODO :: check parts of snipp to pass in the processing func
|
| 157 |
# TODO :: pull pages and split each html and count occurance of important keywords here & check snipp if snipp occurs between . and <p> its good not img
|
| 158 |
|
| 159 |
-
n_results =
|
| 160 |
iter_x = 0
|
| 161 |
for x in new_results:
|
| 162 |
n_results[iter_x] = []
|
|
@@ -189,10 +190,15 @@ async def server_1():
|
|
| 189 |
iter_x = 0
|
| 190 |
for y in n_results :
|
| 191 |
print("y")
|
|
|
|
| 192 |
print(y)
|
| 193 |
-
# print(y)
|
|
|
|
| 194 |
iter_x = iter_x + 1
|
| 195 |
-
|
|
|
|
|
|
|
|
|
|
| 196 |
# nresults={}
|
| 197 |
# new_results loop
|
| 198 |
# sentences loop
|
|
|
|
| 12 |
from langchain_community.utilities import DuckDuckGoSearchAPIWrapper
|
| 13 |
|
| 14 |
|
| 15 |
+
|
| 16 |
API_URL0 = "https://api-inference.huggingface.co/models/sentence-transformers/multi-qa-MiniLM-L6-cos-v1"
|
| 17 |
API_URL1 = "https://api-inference.huggingface.co/models/sentence-transformers/all-mpnet-base-v2"
|
| 18 |
API_URL2 = "https://api-inference.huggingface.co/models/sentence-transformers/all-roberta-large-v1"
|
|
|
|
| 157 |
# TODO :: check parts of snipp to pass in the processing func
|
| 158 |
# TODO :: pull pages and split each html and count occurance of important keywords here & check snipp if snipp occurs between . and <p> its good not img
|
| 159 |
|
| 160 |
+
n_results = {}
|
| 161 |
iter_x = 0
|
| 162 |
for x in new_results:
|
| 163 |
n_results[iter_x] = []
|
|
|
|
| 190 |
iter_x = 0
|
| 191 |
for y in n_results :
|
| 192 |
print("y")
|
| 193 |
+
print(n_results[iter_x])
|
| 194 |
print(y)
|
| 195 |
+
# print(y)
|
| 196 |
+
sentences_comparison.append( n_results[iter_x] )
|
| 197 |
iter_x = iter_x + 1
|
| 198 |
+
|
| 199 |
+
print("sentences_comparison")
|
| 200 |
+
print(sentences_comparison)
|
| 201 |
+
|
| 202 |
# nresults={}
|
| 203 |
# new_results loop
|
| 204 |
# sentences loop
|