Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -690,7 +690,7 @@ def search_documents(query: str) -> str:
|
|
690 |
collection_name = 9 # As per the URL path in your curl example
|
691 |
top_k = 5 # Default value, as shown in the curl
|
692 |
|
693 |
-
url = f"
|
694 |
params = {
|
695 |
"query": query,
|
696 |
"top_k": top_k
|
@@ -1670,7 +1670,7 @@ def save_to_txt(data: dict, filename: str = "datasets_summary.txt"):
|
|
1670 |
print(f"β
Dataset info saved to {filename}")
|
1671 |
|
1672 |
|
1673 |
-
def check_and_create_collection(userLoginId: str, base_url="
|
1674 |
get_url = f"{base_url}/collections/"
|
1675 |
headers = {'accept': 'application/json'}
|
1676 |
|
@@ -1982,8 +1982,10 @@ def health():
|
|
1982 |
if __name__ == "__main__":
|
1983 |
import uvicorn
|
1984 |
try:
|
1985 |
-
uvicorn.run(app
|
1986 |
except KeyboardInterrupt:
|
1987 |
print("\nπ Server stopped gracefully")
|
1988 |
except Exception as e:
|
1989 |
-
print(f"β Server error: {e}")
|
|
|
|
|
|
690 |
collection_name = 9 # As per the URL path in your curl example
|
691 |
top_k = 5 # Default value, as shown in the curl
|
692 |
|
693 |
+
url = f"https://srivatsavdamaraju-accusaga-bot.hf.space/search/{collection_name}"
|
694 |
params = {
|
695 |
"query": query,
|
696 |
"top_k": top_k
|
|
|
1670 |
print(f"β
Dataset info saved to {filename}")
|
1671 |
|
1672 |
|
1673 |
+
def check_and_create_collection(userLoginId: str, base_url="https://srivatsavdamaraju-accusaga-bot.hf.space") -> bool:
|
1674 |
get_url = f"{base_url}/collections/"
|
1675 |
headers = {'accept': 'application/json'}
|
1676 |
|
|
|
1982 |
if __name__ == "__main__":
|
1983 |
import uvicorn
|
1984 |
try:
|
1985 |
+
uvicorn.run(app)
|
1986 |
except KeyboardInterrupt:
|
1987 |
print("\nπ Server stopped gracefully")
|
1988 |
except Exception as e:
|
1989 |
+
print(f"β Server error: {e}")
|
1990 |
+
|
1991 |
+
#bot8.py
|