Skip to content

Commit

Permalink
Add weighted queries
Browse files Browse the repository at this point in the history
  • Loading branch information
do-me committed Feb 27, 2024
1 parent fe97995 commit 3d29bf8
Showing 1 changed file with 105 additions and 52 deletions.
157 changes: 105 additions & 52 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
<title>Qdrant Frontend</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
</head>
<style>
.col {
margin-bottom: 10px;
}

#loading {
display: inline-block;
width: 1rem;
Expand Down Expand Up @@ -46,76 +53,122 @@
<body>

<br />
<div class="text-center">
<h3>Qdrant Frontend (<a href="https://github.com/do-me/qdrant-frontend" target="_blank">GitHub</a>)</h3>
<h5>A universal frontend for <a href="https://qdrant.tech/" target="_blank">Qdrant</a> built with <a href="https://xenova.github.io/transformers.js/" target="_blank">transformers.js</a> to allow<br> for quick semantic search without the need for server-side inferencing.</h5>
<div class="text-center">
<h3>Qdrant Frontend (<a href="https://github.com/do-me/qdrant-frontend" target="_blank">GitHub</a>)</h3>
<h5>A universal frontend for <a href="https://qdrant.tech/" target="_blank">Qdrant</a> built with <a
href="https://xenova.github.io/transformers.js/" target="_blank">transformers.js</a> to allow<br> for
quick semantic search without the need for server-side inferencing.</h5>
</div>
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-6 text-center">
<div class="col">
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-8 text-center">
<h5 class="text-start">Settings</h5>
<div class="col">
<div class="form-floating">
<input id="QdrantURL" class="form-control w-100" type="text"
value="http://localhost:6333/collections/<collection>" />
<label for="QdrantURL">Qdrant Server URL</label>
</div>
</div>
<div class="col">
<div class="row">
<div class="col-md-10"> <!-- Adjusted width for HFModel -->
<div class="form-floating">
<input id="QdrantURL" class="form-control w-100" type="text" value="http://localhost:6333/collections/<collection>" />
<label for="QdrantURL">Qdrant Server URL</label>
<input id="HFModel" class="form-control w-100 mb-2" type="text"
value="Xenova/bge-base-en-v1.5" />
<label for="HFModel">Model</label>
</div>
</div>
<div class="col-md-2 d-flex flex-column align-items-center justify-content-center">
<label class="form-check-label" for="quantizedToggle">Quantized</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="quantizedToggle" checked>
</div>
</div>
<div class="col">

</div>
</div>
<div class="col">
<div class="form-floating">
<input id="QdrantLimit" class="form-control w-100" type="number" min="1" value="10" />
<label for="QdrantLimit"># Results Limit</label>
</div>
</div>

<h5 class="text-start">Weighted Queries</h5>


<div id="queryRowsContainer">
<div class="col row queryContainer" id="initialQueryContainer">

<div class="col-md-8">
<div class="form-floating">
<input id="inputText" class="form-control w-100" type="text" value="Climate Change" />
<label for="inputText">Your Query</label>
<input id="inputText0" class="form-control w-100 inputText" type="text" value="Climate Change" />
<label for="inputText0">Query</label>
</div>
</div>
<div class="col">

<div class="col-md-2">
<div class="form-floating">
<input id="QdrantLimit" class="form-control w-100" type="number" min="1" value="10" />
<label for="QdrantLimit"># Results Limit</label>
<input id="weight0" class="queryWeight form-control" type="number" step="0.1" value="1" min="0" />
<label for="weight0">Weight</label>
</div>
</div>
<div class="col">
<div class="row">
<div class="col-md-10"> <!-- Adjusted width for HFModel -->
<div class="form-floating">
<input id="HFModel" class="form-control w-100 mb-2" type="text" value="Xenova/bge-base-en-v1.5" />
<label for="HFModel">Model</label>
</div>
</div>
<div class="col-md-2"> <!-- Adjusted width for quantized toggle -->
<label class="form-check-label" for="quantizedToggle">Quantized</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="quantizedToggle" checked>
</div>
</div>

<div class="col-md-1 d-flex flex-column align-items-center justify-content-center">
<label class="form-check-label" for="activeToggle0">Active</label>
<div class="form-check form-switch">
<input class="form-check-input activeToggle" type="checkbox" id="activeToggle0" checked>
</div>
</div>





<button type="submit" id="submit_button" class="btn btn-primary mb-2">
<div id="loading" style="display: none;"></div>
<div id="submit_button_text">Load model</div>
</button>

<button id="copyURLButton" class="btn btn-light mb-2">Copy URL (Settings)</button>
<div class="col-md-1 d-flex flex-column align-items-center justify-content-center">

<button class="btn btn-light queryButton" id="queryButton0" type="button" title="Add query"></button>

</div>


</div>
</div>




<div class="row">
<div class="col">
<div class="form-floating">
<button type="submit" id="submit_button" class="btn btn-primary mb-2">
<div id="loading" style="display: none;"></div>
<div id="submit_button_text">Load model</div>
</button>
</div>
</div>
<div class="col">
<button id="copyURLButton" class="btn btn-light mb-2">Copy URL (Settings)</button>
</div>
<div class="col">
<div class="dropdown">
<button class="btn btn-light dropdown-toggle mb-2" type="button" id="exportDropdown" data-bs-toggle="dropdown" aria-expanded="false" disabled>
Export Data
<button class="btn btn-light dropdown-toggle mb-2" type="button" id="exportDropdown"
data-bs-toggle="dropdown" aria-expanded="false" disabled>
Export Data
</button>
<ul class="dropdown-menu" aria-labelledby="exportDropdown">
<li><button id="download_xlsx" class="dropdown-item" type="button">XLSX</button></li>
<li><button id="download_csv" class="dropdown-item" type="button">CSV</button></li>
<li><button id="download_json" class="dropdown-item" type="button">JSON</button></li>
<li><button id="download_xlsx" class="dropdown-item" type="button">XLSX</button></li>
<li><button id="download_csv" class="dropdown-item" type="button">CSV</button></li>
<li><button id="download_json" class="dropdown-item" type="button">JSON</button></li>
</ul>
</div>


</div>
</div>
</div>
<div class="row justify-content-center"></div>



</div>

</div>
<div class="row justify-content-center"></div>
</div>


<div id="table-wrapper">
<div id="quickFilter" class="example-header" style="display: none;">
Expand All @@ -129,4 +182,4 @@ <h5>A universal frontend for <a href="https://qdrant.tech/" target="_blank">Qdra

</body>

</html>
</html>

0 comments on commit 3d29bf8

Please sign in to comment.