Skip to content

Commit

Permalink
feat: ollama script
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed Dec 10, 2023
1 parent 40e1eb2 commit 43a5837
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ public AiResult queryDocuments(SearchDto searchDto) {
var similarDocuments = this.documentVsRepository.retrieve(searchDto.getSearchString(),
searchDto.getResultAmount());
// LOGGER.info("Documents: {}", similarDocuments.size());
// var mostSimilar = similarDocuments.stream()
// .sorted((myDocA, myDocB) -> ((Float) myDocA.getMetadata().get(DISTANCE))
// .compareTo(((Float) myDocB.getMetadata().get(DISTANCE))))
// .findFirst();
var mostSimilarDocs = similarDocuments.stream()
.sorted((myDocA, myDocB) -> ((Float) myDocA.getMetadata().get(DISTANCE))
.compareTo(((Float) myDocB.getMetadata().get(DISTANCE))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class DocSearchComponent {
this.searching = true;
this.repeatSub?.unsubscribe();
this.repeatSub = interval(100).pipe(map(() => new Date()), takeUntilDestroyed(this.destroyRef)).subscribe(newDate => this.msWorking = newDate.getTime() - startDate.getTime());
const documentSearch = {searchString: this.searchValueControl.value, searchType: this.searchTypeControl.value, resultAmount: 10} as DocumentSearch;
const documentSearch = {searchString: this.searchValueControl.value, searchType: this.searchTypeControl.value, resultAmount: 5} as DocumentSearch;
this.documentService.postDocumentSearch(documentSearch)
.pipe(takeUntilDestroyed(this.destroyRef), tap(() => this.searching = false), tap(() => this.repeatSub?.unsubscribe()))
.subscribe(result => {
Expand Down
6 changes: 6 additions & 0 deletions runOllama.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
docker start ollama
docker stop ollama
docker exec -it ollama ollama run orca2:13b
docker exec -it ollama ollama run stable-beluga:13b

0 comments on commit 43a5837

Please sign in to comment.