Spaces:
Paused
Paused
import requests | |
def search(query, port=7860, top=15): | |
response = requests.post(f"https://muryshev-chatbot-demo-search.hf.space/search", | |
json={"query": query, 'top': top,}) | |
if response.status_code == 200: | |
doc_names = response.json().get("predictions", []) | |
texts = response.json().get("documents", []) | |
else: | |
print(f"Error: {response.status_code}") | |
print(response.text) | |
return doc_names, texts | |
# query = 'Как красить бетон?' | |
# names, texts = search(query) | |
# print(texts) |