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

JabRef doesn't quit #178

Open
koppor opened this issue Sep 3, 2024 · 3 comments
Open

JabRef doesn't quit #178

koppor opened this issue Sep 3, 2024 · 3 comments

Comments

@koppor
Copy link
Collaborator

koppor commented Sep 3, 2024

image

All UI is closed, but the "run" task is still active.

I had a group chat opened.

@InAnYan
Copy link
Owner

InAnYan commented Sep 4, 2024

I pushed some fix for this.

My guess: probably the PDF reading part was not closed

@InAnYan InAnYan added the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Sep 4, 2024
@koppor
Copy link
Collaborator Author

koppor commented Sep 4, 2024

No...

image

@koppor
Copy link
Collaborator Author

koppor commented Sep 4, 2024

I think, it is because of the thing @loay was reporting at JabRef#11701

ERROR: Got an error while sending a message to AI: java.lang.RuntimeException: ai.djl.translate.TranslateException: java.lang.IllegalStateException: NDManager has been closed already.
        at [email protected]/org.jabref.logic.ai.ingestion.model.DeepJavaEmbeddingModel.embedAll(DeepJavaEmbeddingModel.java:47)
        at [email protected]/org.jabref.logic.ai.ingestion.model.JabRefEmbeddingModel.embedAll(JabRefEmbeddingModel.java:131)
        at [email protected]/dev.langchain4j.model.embedding.EmbeddingModel.embed(EmbeddingModel.java:34)
        at [email protected]/dev.langchain4j.model.embedding.EmbeddingModel.embed(EmbeddingModel.java:24)
        at [email protected]/dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever.retrieve(EmbeddingStoreContentRetriever.java:179)
        at [email protected]/dev.langchain4j.rag.DefaultRetrievalAugmentor.process(DefaultRetrievalAugmentor.java:174)
        at [email protected]/dev.langchain4j.rag.DefaultRetrievalAugmentor.augment(DefaultRetrievalAugmentor.java:154)
        at [email protected]/dev.langchain4j.chain.ConversationalRetrievalChain.augment(ConversationalRetrievalChain.java:96)
        at [email protected]/dev.langchain4j.chain.ConversationalRetrievalChain.execute(ConversationalRetrievalChain.java:82)
        at [email protected]/dev.langchain4j.chain.ConversationalRetrievalChain.execute(ConversationalRetrievalChain.java:32)
        at [email protected]/org.jabref.logic.ai.chatting.AiChatLogic.execute(AiChatLogic.java:168)
        at [email protected]/org.jabref.gui.ai.components.aichat.AiChatComponent.lambda$onSendMessage$8(AiChatComponent.java:203)
        at [email protected]/org.jabref.gui.util.BackgroundTask$1.call(BackgroundTask.java:82)
        at [email protected]/org.jabref.gui.util.UiTaskExecutor$1.call(UiTaskExecutor.java:170)
        at [email protected]/javafx.concurrent.Task$TaskCallable.call(Task.java:1399)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: ai.djl.translate.TranslateException: java.lang.IllegalStateException: NDManager has been closed already.
        at [email protected]/ai.djl.inference.Predictor.batchPredict(Predictor.java:196)
        at [email protected]/ai.djl.inference.Predictor.predict(Predictor.java:132)
        at [email protected]/org.jabref.logic.ai.ingestion.model.DeepJavaEmbeddingModel.embedAll(DeepJavaEmbeddingModel.java:33)
        ... 20 more
Caused by: java.lang.IllegalStateException: NDManager has been closed already.
        at [email protected]/ai.djl.ndarray.BaseNDManager.attachUncappedInternal(BaseNDManager.java:328)
        at [email protected]/ai.djl.pytorch.engine.PtNDManager.newSubManager(PtNDManager.java:185)
        at [email protected]/ai.djl.pytorch.engine.PtNDManager.newSubManager(PtNDManager.java:31)
        at [email protected]/ai.djl.ndarray.BaseNDManager.newSubManager(BaseNDManager.java:265)
        at [email protected]/ai.djl.inference.Predictor$PredictorContext.<init>(Predictor.java:363)
        at [email protected]/ai.djl.inference.Predictor.batchPredict(Predictor.java:158)
        ... 22 more
2024-09-04 14:38:36 [main] org.jabref.Launcher.main()
ERROR: Unexpected exception: java.lang.RuntimeException: Exception in Application stop method
        at [email protected]/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:898)
        at [email protected]/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.util.NoSuchElementException: java.lang.IndexOutOfBoundsException
        at java.base/java.util.AbstractList$Itr.next(AbstractList.java:379)
        at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
        at [email protected]/org.jabref.gui.util.UiTaskExecutor.shutdown(UiTaskExecutor.java:131)
        at [email protected]/org.jabref.gui.JabRefGUI.shutdownThreadPools(JabRefGUI.java:382)
        at [email protected]/org.jabref.gui.JabRefGUI.stop(JabRefGUI.java:372)
        at [email protected]/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$10(LauncherImpl.java:858)
        at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
        at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
        at [email protected]/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at [email protected]/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at [email protected]/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
        ... 1 more
Caused by: java.lang.IndexOutOfBoundsException
        at [email protected]/javafx.collections.transformation.FilteredList.get(FilteredList.java:169)
        at [email protected]/com.tobiasdiez.easybind.MappedList.get(MappedList.java:31)
        at java.base/java.util.AbstractList$Itr.next(AbstractList.java:373)
        ... 15 more

@koppor koppor removed the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Sep 4, 2024
github-merge-queue bot pushed a commit to JabRef/jabref that referenced this issue Sep 4, 2024
* AI chat UI overhaul

* Chat history and AI chat overhaul

* Implement ingestion logic

* Implement ingestion logic

* Accept list of entries

* Group chat history logic

* Move components to folders and introduce AiPrivacyNoticeGuardedComponent

* Move components to folders and introduce AiPrivacyNoticeGuardedComponent

* Introduce EmbeddingModelGuardedComponent

* SummaryComponent overhaul

* Summarization logic overhaul

* Finish work on refactoring the summarization

* Introduce group chats

* Introduce group chat

* Refactor AI code

* AI chat UI overhaul

* Chat history and AI chat overhaul

* Implement ingestion logic

* Implement ingestion logic

* Accept list of entries

* Group chat history logic

* Move components to folders and introduce AiPrivacyNoticeGuardedComponent

* Move components to folders and introduce AiPrivacyNoticeGuardedComponent

* Introduce EmbeddingModelGuardedComponent

* SummaryComponent overhaul

* Summarization logic overhaul

* Finish work on refactoring the summarization

* Introduce group chats

* Introduce group chat

* Refactor AI code

* Fix GenerateEmbeddingsTask

* Introduce windows

* Refactor notifications

* No linting errors occurring

* Improve chat history component

* Discard changes to src/main/java/module-info.java

* Refine JavaDoc

* Fix for InAnYan#173

* Fix for InAnYan#171

* Fix from code review

* Fix checkers

* Fix for InAnYan#175 and InAnYan#174

* Follow-up for InAnYan#175

* Fix for InAnYan#166

* Fix for InAnYan#164

* Fix checkers

* Fix from code review

* Update src/main/java/org/jabref/gui/ai/components/aichat/AiChatGuardedComponent.java

Co-authored-by: Oliver Kopp <[email protected]>

* Fix for InAnYan#166 and fix for InAnYan#176

* Might be fix for InAnYan#178

* Migrate from AbstractGroup to GroupTreeNode

* Fix for InAnYan#170

* Fix for InAnYan#164

* InAnYan#177

* Fix for InAnYan#180

* Fix checkers

* Fix the system message

* Fix for InAnYan#180

* Fix context menu order

* Fix `startsWith`

* Fix system message

* Fix for ProgressCounter

* Fix for system message

---------

Co-authored-by: Oliver Kopp <[email protected]>
@koppor koppor removed the groupchat label Sep 4, 2024
@koppor koppor added this to the Chat with a group of documents milestone Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants