Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching embedding model leads to error #154

Open
2 tasks done
ThiloteE opened this issue Aug 14, 2024 · 2 comments
Open
2 tasks done

Switching embedding model leads to error #154

ThiloteE opened this issue Aug 14, 2024 · 2 comments
Labels
bug Something isn't working Priority: normal Issue has normal priority

Comments

@ThiloteE
Copy link
Collaborator

JabRef version

Other (please describe below)

Operating system

Windows

Details on version and operating system

Windows 10, commit 8aa5fbb

Checked with the latest development build (copy version output from About dialog)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. (not sure, if necessary) Have conversation in AI chat.
  2. Go to preferences
  3. Choose different embedding model
  4. Go to chat with ai tab --> reindexing is being done --> wait --> error will pop.

Appendix

...

Log File
java.lang.NullPointerException: Cannot invoke "org.jabref.logic.ai.chathistory.BibDatabaseChatHistoryManager$ChatHistoryRecord.toLangchainMessage()" because the return value of "java.util.Map.get(Object)" is null
	at org.jabref@100.0.0/org.jabref.logic.ai.chathistory.BibDatabaseChatHistoryManager$1.lambda$getMessages$0(BibDatabaseChatHistoryManager.java:70)
	at java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180)
	at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104)
	at java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:712)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at org.jabref@100.0.0/org.jabref.logic.ai.chathistory.BibDatabaseChatHistoryManager$1.getMessages(BibDatabaseChatHistoryManager.java:71)
	at org.jabref@100.0.0/org.jabref.logic.ai.AiChatLogic.<init>(AiChatLogic.java:48)
	at org.jabref@100.0.0/org.jabref.logic.ai.AiChatLogic.forBibEntry(AiChatLogic.java:65)
	at org.jabref@100.0.0/org.jabref.gui.entryeditor.AiChatTab.bindToCorrectEntry(AiChatTab.java:236)
	at org.jabref@100.0.0/org.jabref.gui.entryeditor.AiChatTab.bindToEntry(AiChatTab.java:118)
	at org.jabref@100.0.0/org.jabref.gui.entryeditor.AiChatTab.handleFocus(AiChatTab.java:89)
	at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
	at javafx.graphics@22.0.2/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at javafx.graphics@22.0.2/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics@22.0.2/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
	at java.base/java.lang.Thread.run(Thread.java:1583)
@ThiloteE ThiloteE added bug Something isn't working Priority: normal Issue has normal priority labels Aug 14, 2024
@ThiloteE
Copy link
Collaborator Author

@ThiloteE
Copy link
Collaborator Author

...

Log File
C:\Prog\Development\JabRef_JabRef-JabRef\JabRef-JabRef\jabref>gradle run

> Configure project :

> Task :run
WARNING: Using incubator modules: jdk.incubator.vector
Messages are not initialized before accessing key: Display help on command line options
2024-08-14 15:40:48 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.addStylesheetToWatchlist()
INFO: Watching css C:\Prog\Development\JabRef_JabRef-JabRef\JabRef-JabRef\jabref\build\resources\main\org\jabref\gui\Base.css for live updatesie die Kompilierung mit -Xlint:unchecked, um Details zu erhalten.
2024-08-14 15:40:48 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Not updating theme because it hasn't changed
2024-08-14 15:40:48 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Theme set to Theme{type=EMBEDDED, name='Dark.css'} with base css StyleSheet{file:/C:/Prog/Development/JabRef_JabRef-JabRef/JabRef-JabRef/jabref/build/resources/main/org/jabref/gui/Base.css}
2024-08-14 15:40:48 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.addStylesheetToWatchlist()
INFO: Watching css C:\Prog\Development\JabRef_JabRef-JabRef\JabRef-JabRef\jabref\build\resources\main\org\jabref\gui\Dark.css for live updates
2024-08-14 15:40:49 [pool-2-thread-1] org.jabref.logic.ai.models.UpdateEmbeddingModelTask.call()
INFO: Downloading embedding model...
2024-08-14 15:40:50 [JavaFX Application Thread] org.jabref.gui.StateManager.setActiveDatabase()
INFO: No open database detected
2024-08-14 15:40:52 [pool-2-thread-2] org.jabref.gui.JabRefDialogService.notify()
INFO: Opening: 'C:\server-t-150\Jabref & LatexTests\OneMillionEntries.bib'
2024-08-14 15:40:53 [pool-2-thread-2] org.jabref.gui.JabRefDialogService.notify()
INFO: Opening: 'C:\server-t-150\Jabref & LatexTests\test-Files.bib'
2024-08-14 15:40:53 [pool-2-thread-3] org.jabref.gui.JabRefDialogService.notify()
INFO: Opening: 'C:\4.12.0 used for code generation does not match the current runtime version 4.13.2                    ANTLR Tool version
ANTLR Runtime version 4.12.0 used for parser compilation does not match the current runtime version 4.13.2
ANTLR Tool version 4.12.0 used for code generation does not match the current runtime version 4.13.2hput. See: https://d
ANTLR Runtime version 4.12.0 used for parser compilation does not match the current runtime version 4.13.2
ANTLR Tool version 4.12.0 used for code generation does not match the current runtime version 4.13.2
ANTLR Runtime version 4.12.0 used for parser compilation does not match the current runtime version 4.13.2
ANTLR Tool version 4.12.0 used for code generation does not match the current runtime version 4.13.2
ANTLR Runtime version 4.12.0 used for parser compilation does not match the current runtime version 4.13.2
2024-08-14 15:41:16 [JavaFX Application Thread] org.jabref.logic.push.CitationCommandString.from()
INFO: Wrong indexes -1 -1 for completeCiteCommand \parencite. Using default delimiter and suffix.
2024-08-14 16:05:52 [pool-2-thread-2] org.jabref.logic.ai.models.UpdateEmbeddingModelTask.call()
INFO: Downloading embedding model...
2024-08-14 16:05:53 [JavaFX Application Thread] org.jabref.gui.JabRefDialogService.notify()
INFO: Preferences recorded.
2024-08-14 16:05:54 [Finalizer] ai.djl.BaseModel.finalize()
WARN: Model: all-MiniLM-L12-v2 was not closed explicitly.
2024-08-14 16:06:20 [JavaFX Application Thread] org.jabref.logic.ai.models.JabRefEmbeddingModel.lambda$startRebuildingTask$0()
INFO: Embedding model was successfully updated
2024-08-14 16:06:20 [JavaFX Application Thread] org.jabref.gui.FallbackExceptionHandler.uncaughtException()
ERROR: Uncaught exception occurred in Thread[#43,JavaFX Application Thread,5,main]: java.lang.NullPointerException: Cannot invoke "org.jabref.logic.ai.chathistory.BibDatabaseChatHistoryManager$ChatHistoryRecord.toLangchainMessage()" because the return value of "java.util.Map.get(Object)" is null
        at org.jabref@100.0.0/org.jabref.logic.ai.chathistory.BibDatabaseChatHistoryManager$1.lambda$getMessages$0(BibDatabaseChatHistoryManager.java:70)
        at java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180)
        at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104)
        at java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:712)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
        at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
        at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
        at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
        at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
        at org.jabref@100.0.0/org.jabref.logic.ai.chathistory.BibDatabaseChatHistoryManager$1.getMessages(BibDatabaseChatHistoryManager.java:71)
2024-08-14 16:14:44 [pool-2-thread-5] org.jabref.logic.ai.GenerateEmbeddingsTask.call()
INFO: Starting embeddings generation task for entry Corti_2009forBibEntry(AiChatLogic.java:65)
2024-08-14 16:14:44 [pool-2-thread-5] org.jabref.logic.ai.GenerateEmbeddingsTask.ingestLinkedFile()a:236)
INFO: Generating embeddings for file "DownloadedViaJabRef/Corti et al. (2009-03) Cocoa Cardiovascular Health.pdf" of entry Corti_2009
2024-08-14 16:14:46 [JavaFX Application Thread] org.jabref.gui.entryeditor.AiChatTab.showErrorWhileIngesting()
ERROR: Got an error while generating embeddings for entry Optional[Corti_2009]: java.lang.RuntimeException: ai.djl.translate.TranslateException: ai.djl.engine.EngineException: default_program(24): error: extra text after expected end of number  at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
          aten_mul[(long long)(threadIdx.x) + 512ll * (long long)(blockIdx.x)] = v * -3.402823466385289e+38.f;:455)
                                                                                                           ^va:95)
        at javafx.graphics@22.0.2/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
default_program(28): error: extra text after expected end of numberon.lambda$runLoop$3(WinApplication.java:184)
      aten_add[(long long)(threadIdx.x) + 512ll * (long long)(blockIdx.x)] = v_1 / 5.656854152679443f + v_2 * -3.402823466385289e+38.f;
                                                                                                                                    ^
> :run
2 errors detected in the compilation of "default_program".

nvrtc compilation failed:

#define NAN __int_as_float(0x7fffffff)
#define POS_INFINITY __int_as_float(0x7f800000)
#define NEG_INFINITY __int_as_float(0xff800000)


template<typename T>
__device__ T maximum(T a, T b) {
  return isnan(a) ? a : (a > b ? a : b);
}

template<typename T>
__device__ T minimum(T a, T b) {
  return isnan(a) ? a : (a < b ? a : b);
}

extern "C" __global__
void fused_mul_div_add(float* tattention_scores_2, float* tv_, float* aten_add, float* aten_mul) {
{
if (blockIdx.x<1ll ? 1 : 0) {
if ((long long)(threadIdx.x) + 512ll * (long long)(blockIdx.x)<66ll ? 1 : 0) {
if (blockIdx.x<1ll ? 1 : 0) {
        float v = __ldg(tv_ + (long long)(threadIdx.x) + 512ll * (long long)(blockIdx.x));
        aten_mul[(long long)(threadIdx.x) + 512ll * (long long)(blockIdx.x)] = v * -3.402823466385289e+38.f;
      }    }  }if ((long long)(threadIdx.x) + 512ll * (long long)(blockIdx.x)<52272ll ? 1 : 0) {
    float v_1 = __ldg(tattention_scores_2 + (long long)(threadIdx.x) + 512ll * (long long)(blockIdx.x));
    float v_2 = __ldg(tv_ + ((long long)(threadIdx.x) + 512ll * (long long)(blockIdx.x)) % 66ll);
    aten_add[(long long)(threadIdx.x) + 512ll * (long long)(blockIdx.x)] = v_1 / 5.656854152679443f + v_2 * -3.402823466385289e+38.f;
  }}
}

        at org.jabref@100.0.0/org.jabref.logic.ai.models.DeepJavaEmbeddingModel.embedAll(DeepJavaEmbeddingModel.java:47)
        at org.jabref@100.0.0/org.jabref.logic.ai.models.JabRefEmbeddingModel.embedAll(JabRefEmbeddingModel.java:130)
        at langchain4j.core@0.33.0/dev.langchain4j.store.embedding.EmbeddingStoreIngestor.ingest(EmbeddingStoreIngestor.java:193)
        at langchain4j.core@0.33.0/dev.langchain4j.store.embedding.EmbeddingStoreIngestor.ingest(EmbeddingStoreIngestor.java:150)
        at org.jabref@100.0.0/org.jabref.logic.ai.embeddings.LowLevelIngestor.ingestDocument(LowLevelIngestor.java:71)
        at org.jabref@100.0.0/org.jabref.logic.ai.FileEmbeddingsManager.addDocument(FileEmbeddingsManager.java:62)
        at org.jabref@100.0.0/org.jabref.logic.ai.GenerateEmbeddingsTask.ingestLinkedFile(GenerateEmbeddingsTask.java:99)
        at org.jabref@100.0.0/org.jabref.logic.ai.GenerateEmbeddingsTask.call(GenerateEmbeddingsTask.java:58)
        at org.jabref@100.0.0/org.jabref.logic.ai.GenerateEmbeddingsTask.call(GenerateEmbeddingsTask.java:23)
        at org.jabref@100.0.0/org.jabref.gui.util.UiTaskExecutor$1.call(UiTaskExecutor.java:170)
        at javafx.graphics@22.0.2/javafx.concurrent.Task$TaskCallable.call(Task.java:1399)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)

<\details>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: normal Issue has normal priority
Projects
None yet
Development

No branches or pull requests

1 participant