load vectors from DocsHUB

This commit is contained in:
Alex
2023-02-07 21:53:29 +00:00
parent 7b648834f4
commit 2eb7113260
11 changed files with 107 additions and 52 deletions

View File

@@ -61,12 +61,10 @@ This will return a new DataFrame with all the columns from both tables, and only
<p class="text-sm">The source code is available on <a href="https://github.com/arc53/docsgpt" class="text-blue-500 hover:text-blue-800">Github</a></p><br>
<p class="text-sm">Currently It uses python pandas documentation, so it will respond to information relevant to pandas. If you want to train it on different documentation - <a href="https://github.com/arc53/docsgpt/wiki/How-to-train-on-other-documentation" class="text-blue-500 hover:text-blue-800"> please follow this guide </a></p><br>
<p class="text-sm">If you want to launch it on your own server - <a href="https://github.com/arc53/docsgpt/wiki/How-to-train-on-other-documentation" class="text-blue-500 hover:text-blue-800"> follow this guide </a></p><br>
<label class="block mb-2 text-sm font-medium text-gray-900">Select pre-loaded documentation</label>
<label class="block mb-2 text-sm font-medium text-gray-900">Select documentation from DocsHUB</label>
<select id="select-docs" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
<option selected>Choose documentation</option>
<option value="ethereum/solidity/">Solidity</option>
<option value="python/pandas/">Pandas</option>
<option value="python/scikit-learn/">scikit-learn</option>
<option value="default">Default</option>
</select>
</div>
</div>
@@ -103,6 +101,35 @@ This will return a new DataFrame with all the columns from both tables, and only
console.log("apiKey is not set")
document.getElementById('modal').classList.toggle('hidden')
}
if (localStorage.getItem('docsIndex') === null) {
console.log("docsIndex is not set")
docsIndex()
}
docsIndex = localStorage.getItem('docsIndex')
// create option on select with id select-docs
var select = document.getElementById("select-docs");
// convert docsIndex to json
docsIndex = JSON.parse(docsIndex)
// create option for each key in docsIndex
for (var key in docsIndex) {
var option = document.createElement("option");
console.log(key)
console.log(docsIndex[key])
if (docsIndex[key].name == docsIndex[key].language) {
option.text = docsIndex[key].name + " " + docsIndex[key].version;
option.value = docsIndex[key].name + "/" + ".project" + "/" + docsIndex[key].version + "/";
select.add(option);
}
else {
option.text = docsIndex[key].name + " " + docsIndex[key].version;
option.value = docsIndex[key].language + "/" + docsIndex[key].name + "/" + docsIndex[key].version + "/";
select.add(option);
}
}
</script>
<script src="{{url_for('static',filename='src/authapi.js')}}"></script>
<script src="{{url_for('static',filename='src/chat.js')}}"></script>