id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_77190942 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why can we set LLM's input and output to be the same when fine tuning on text generation task? | Why can we set LLM's input and output to be the same when fine tuning on text generation task?
I'm trying to fine tune my GPT-2 model for song lyrics text generation, and I have a couple of song lyrics on hand. However, I'm confused about how to fine tune GPT-2 model that doesn't have standard input and outputs fo... | https://stackoverflow.com/questions/77190942/why-can-we-set-llms-input-and-output-to-be-the-same-when-fine-tuning-on-text-ge | machine-learning, nlp, large-language-model, fine-tuning, gpt-2 | 1,695,849,301 |
se_79762554 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Azure ML Endpoint Fails with HFValidationError even after using pathlib.Path | Azure ML Endpoint Fails with HFValidationError even after using pathlib.Path
I am trying to deploy a fine-tuned Mistral-7B model on an Azure ML Online Endpoint. The deployment repeatedly fails during the init() phase of the scoring script with an huggingface_hub.errors.HFValidationError, even after applying the standa... | https://stackoverflow.com/questions/79762554/azure-ml-endpoint-fails-with-hfvalidationerror-even-after-using-pathlib-path | python, huggingface-transformers, large-language-model, azure-machine-learning-service, peft | 1,757,653,521 |
se_79571867 | stackoverflow | ARTIFICIAL_INTELLIGENCE | problem with prompting using FAISS as a vector store to classify dialogs based on sentiment emotions | problem with prompting using FAISS as a vector store to classify dialogs based on sentiment emotions
I have a .csv dataset consisting of text dialog between two people and the rating of the related emaotions:
| Text_Dialog | joy | anger | sad | happy |
|--------------------|-----|-------|-----|-------|
| -Tom:"... | https://stackoverflow.com/questions/79571867/problem-with-prompting-using-faiss-as-a-vector-store-to-classify-dialogs-based-o | python, langchain, large-language-model, faiss, vectorstore | 1,744,567,722 |
se_79758366 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Zep Graphiti - core - Adding Episode fails the LLM structured output | Zep Graphiti - core - Adding Episode fails the LLM structured output
On the ingestion part to the graph db, I pass a json file, as an episode, custom entities (and edges), using gemini api, but I get some discrepancy on the structured output, like so:
LLM generation failed parsing as JSON, will try to salvage."
Input ... | https://stackoverflow.com/questions/79758366/zep-graphiti-core-adding-episode-fails-the-llm-structured-output | neo4j, artificial-intelligence, large-language-model, google-gemini, rag | 1,757,279,506 |
se_76499108 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to protect your github code against being used for llm training | How to protect your github code against being used for llm training
The recent rise of LLMs trained on vast amounts of data, including OS repositories, leads to a licensing question.
Suppose you are OK for other human developers to build on your code but do not want to allow the likes of OpenAI to use your code for tr... | https://stackoverflow.com/questions/76499108/how-to-protect-your-github-code-against-being-used-for-llm-training | operating-system, licensing, large-language-model | 1,687,064,953 |
se_79754770 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to dynamically register Language Model Tools in a VS Code extension? | How to dynamically register Language Model Tools in a VS Code extension?
I want to register different Language Model Tools in my VS Code extension depending on a specific configuration.
Currently, the way VS Code works seems to be:
I need to declare the tool in package.json first.
Then, I can implement the tool in my ... | https://stackoverflow.com/questions/79754770/how-to-dynamically-register-language-model-tools-in-a-vs-code-extension | visual-studio-code, vscode-extensions, large-language-model, github-copilot | 1,756,911,367 |
se_77745229 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OSError: Error no file named model.safetensors found in directory | OSError: Error no file named model.safetensors found in directory
I am trying to load a LLAMA2 model saved in Hugging Face safe tensors format. The model is saved in two parts model-part1.safetensors and model-part2.safetensors.
I am using LlamaForCausalLM.from_pretrained() Hugging Face API to load the model.
When I p... | https://stackoverflow.com/questions/77745229/oserror-error-no-file-named-model-safetensors-found-in-directory | huggingface-transformers, large-language-model, huggingface, llama | 1,704,188,397 |
se_79756054 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to send extra headers from RAGFlow Agent to a Spring Boot MCP server tool call? | How to send extra headers from RAGFlow Agent to a Spring Boot MCP server tool call?
I am using RAGFlow
connected to a Spring Boot MCP server.
My agent flow is simple:
Begin node → collects inputs (auth_token, tenant_id, x_request_status)
Agent (gpt-4o) → connected to
MCP Tool (server) → exposes Spring methods annotate... | https://stackoverflow.com/questions/79756054/how-to-send-extra-headers-from-ragflow-agent-to-a-spring-boot-mcp-server-tool-ca | spring, artificial-intelligence, large-language-model, rag, model-context-protocol | 1,757,007,909 |
se_79225401 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use AzureOpenai instance model inside RAGAS - [ not langchain] | How to use AzureOpenai instance model inside RAGAS - [ not langchain]
I am having these secrets and this is how I use gpt-4o model:
from ragas import SingleTurnSample
from ragas.metrics import ResponseRelevancy
import os
from openai import AzureOpenAI
from ragas import evaluate
import requests
To get the secret key... | https://stackoverflow.com/questions/79225401/how-to-use-azureopenai-instance-model-inside-ragas-not-langchain | python-3.x, openai-api, large-language-model, ragas | 1,732,598,201 |
se_79570131 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ragas evaluator function is taking LLM model as none even it is passed in evaluator's function call | ragas evaluator function is taking LLM model as none even it is passed in evaluator's function call
%python
# %pip install openai langchain
from ragas.metrics import answer_relevancy, faithfulness, context_utilization
from ragas.evaluation import evaluate
from azure.identity import DefaultAzureCredential
import o... | https://stackoverflow.com/questions/79570131/ragas-evaluator-function-is-taking-llm-model-as-none-even-it-is-passed-in-evalua | python, large-language-model, evaluator, ragas | 1,744,441,605 |
se_79754447 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Cannot import `QwenForCausalLM` after installing `v4.51.3-Qwen2.5-Omni-preview` tag; pip installs 4.52.0.dev0 instead | Cannot import `QwenForCausalLM` after installing `v4.51.3-Qwen2.5-Omni-preview` tag; pip installs 4.52.0.dev0 instead
Description:
I am trying to install the Hugging Face Transformers version that supports the Qwen2.5-Omni model. According to the official docs, the correct tag to install is v4.51.3-Qwen2.5-Omni-previe... | https://stackoverflow.com/questions/79754447/cannot-import-qwenforcausallm-after-installing-v4-51-3-qwen2-5-omni-preview | python, huggingface-transformers, large-language-model, transformer-model | 1,756,894,642 |
se_79745092 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Smolagents CodeAgent gets error from correct code | Smolagents CodeAgent gets error from correct code
the Smolagents CodeAgent is given a task to convert a string into markdown table format. It successfully captures the related part of the string and writes the code for markdown table formatting. However, it keeps receiving the same error. I copied and run the code on ... | https://stackoverflow.com/questions/79745092/smolagents-codeagent-gets-error-from-correct-code | python-3.x, large-language-model, agent, huggingface | 1,756,060,356 |
se_79750455 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to upsert documents to Flowise document store using API Loader instead of file upload? | How to upsert documents to Flowise document store using API Loader instead of file upload?
’m currently working with Flowise and trying to update my document store via API requests.
I followed the documentation here.
Specifically, I want to try Scenario 2: In the same document store, replace an existing document loade... | https://stackoverflow.com/questions/79750455/how-to-upsert-documents-to-flowise-document-store-using-api-loader-instead-of-fi | artificial-intelligence, large-language-model | 1,756,479,259 |
se_79126460 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Using fine tuned flux-dev model from Replicate platform locally? | Using fine tuned flux-dev model from Replicate platform locally?
I've fine tuned flux-dev model using Replicate platform. I've downloaded the weights after the training process but I do not want to generate images on web interface. Instead I want to use my local resources to generate images. Currently, I generate imag... | https://stackoverflow.com/questions/79126460/using-fine-tuned-flux-dev-model-from-replicate-platform-locally | python, large-language-model, replicate | 1,729,872,121 |
se_79749305 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can't connect to Ollama hosted locally from python script | Can't connect to Ollama hosted locally from python script
I am building ETL using LLM to extract some information.
I have ollama installed locally. I am on Macbook M4 Max.
I don't understand why I have this error from my worker.
ads-worker-1 | 2025-08-28 15:05:54,983 - INFO - Got the db connection: <connection ob... | https://stackoverflow.com/questions/79749305/cant-connect-to-ollama-hosted-locally-from-python-script | docker, docker-compose, etl, large-language-model, ollama | 1,756,394,656 |
se_79747316 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Failed to build installable wheels for some pyproject.toml based projects llama-cpp-python | Failed to build installable wheels for some pyproject.toml based projects llama-cpp-python
I tried to install llama-cpp-python via pip, but I have an error with the installation
The command that I wrote:
CMAKE_ARGS="-DLLAMA_METAL_EMBED_LIBRARY=ON -DLLAMA_METAL=on" pip install llama-cpp-python --no-cache-dir
and here's... | https://stackoverflow.com/questions/79747316/failed-to-build-installable-wheels-for-some-pyproject-toml-based-projects-llama | python, macos, large-language-model, llama-cpp-python | 1,756,241,605 |
se_77680167 | stackoverflow | ARTIFICIAL_INTELLIGENCE | The differences between Qdrant upload_records and upsert methods? | The differences between Qdrant upload_records and upsert methods?
I am new to the Qdrant vector database and its literature. As I understand, for uploading data to the Qdrant client database, we use uploading methods such as upsert and upload_records but I did not get when should use each one.
Can anyone clarify the u... | https://stackoverflow.com/questions/77680167/the-differences-between-qdrant-upload-records-and-upsert-methods | large-language-model, vector-database, semantic-search, qdrant, qdrantclient | 1,702,914,181 |
se_79745097 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Agent not using both tool specs | Agent not using both tool specs
I've created an Agent using llama index. When I specify only one tool spec, it works correctly. However, when I try to use two, one is ignored.
import asyncio
import logging
import os
from dotenv import load_dotenv
from llama_index.core.agent import ReActAgent
from llama_index.core.age... | https://stackoverflow.com/questions/79745097/agent-not-using-both-tool-specs | large-language-model, agent, llama-index | 1,756,060,602 |
se_77731763 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Insert metadata Flowise + pinecone | Insert metadata Flowise + pinecone
I am trying to do an upsert in Pinecone using Flowise. As I need to do this for several PDF files, I am using the 'Folder with Files' node. So far so good, but I have the need to insert as metadata a part of the file names. These files follow the standard naming convention: XXXXX-XXX... | https://stackoverflow.com/questions/77731763/insert-metadata-flowise-pinecone | langchain, large-language-model, pinecone, flowise | 1,703,849,833 |
se_79733790 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to store Gemini 2.5 Flash + MCP multi-turn conversation data (including tool calls and responses)? | How to store Gemini 2.5 Flash + MCP multi-turn conversation data (including tool calls and responses)?
I’m building a multi-turn conversation system using Gemini 2.5 Flash with thinking and Model Context Protocol (MCP) tool calls.
With OpenAI models, I usually store conversation history as an array of messages (role, ... | https://stackoverflow.com/questions/79733790/how-to-store-gemini-2-5-flash-mcp-multi-turn-conversation-data-including-tool | python, json, artificial-intelligence, large-language-model, google-gemini | 1,755,050,952 |
se_79709987 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to ensure all documents contribute to summary context after merging indexes? | How to ensure all documents contribute to summary context after merging indexes?
I'm building a LangChain RAG pipeline using the FAISS vector store. I'm merging multiple FAISS indexes — each representing one document — and then querying them to generate summaries or answers via OpenAI's LLM.
# Merge multiple FAISS vec... | https://stackoverflow.com/questions/79709987/how-to-ensure-all-documents-contribute-to-summary-context-after-merging-indexes | langchain, large-language-model, rag, faiss | 1,753,165,309 |
se_79691404 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is there a way to manually set the first part of a model's response in Ollama? | Is there a way to manually set the first part of a model's response in Ollama?
A bit of context,
I recently got into tinkering with LLMs using the ollama python package. My latest project is an AI assistant (how original, I know) with tool calling capabilities. I'm using the qwen3:4b model, and while due to it's s... | https://stackoverflow.com/questions/79691404/is-there-a-way-to-manually-set-the-first-part-of-a-models-response-in-ollama | python, artificial-intelligence, large-language-model, ollama | 1,751,759,821 |
se_79726988 | stackoverflow | ARTIFICIAL_INTELLIGENCE | FastAPI endpoint stream LLM output word for word | FastAPI endpoint stream LLM output word for word
I have a FastAPI endpoint (/generateStreamer) that generates responses from an LLM model. I want to stream the output so users can see the text as it’s being generated, rather than waiting for the full response. Currently, I'm using TextIteratorStreamer from the transfo... | https://stackoverflow.com/questions/79726988/fastapi-endpoint-stream-llm-output-word-for-word | python, fastapi, huggingface-transformers, large-language-model | 1,754,467,527 |
se_79727531 | stackoverflow | ARTIFICIAL_INTELLIGENCE | TypeError: PPOTrainer.__init__() got an unexpected keyword argument 'config' | TypeError: PPOTrainer.__init__() got an unexpected keyword argument 'config'
I am trying to initialize a PPO_trainer but have issues.
from trl import PPOTrainer, PPOConfig
ppo_config = PPOConfig(
batch_size=4,
learning_rate=1e-5,
mini_batch_size=2,
use_cpu=True
)
ppo_trainer = PPOTrainer(
... | https://stackoverflow.com/questions/79727531/typeerror-ppotrainer-init-got-an-unexpected-keyword-argument-config | python, large-language-model, huggingface | 1,754,494,987 |
se_78863892 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain unpredicted behavior create_sql_query_chain | Langchain unpredicted behavior create_sql_query_chain
I am new to Langchain and I try to currently wrap my head around a tutorial to build a LLM Agent to interact with a SQL data base (https://python.langchain.com/v0.2/docs/tutorials/sql_qa/).
I am running into issues early on. When I run the code, the create_sql_quer... | https://stackoverflow.com/questions/78863892/langchain-unpredicted-behavior-create-sql-query-chain | langchain, large-language-model | 1,723,505,172 |
se_76867963 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to create a custom tool in create_pandas_dataframe_agent in langchain? | How to create a custom tool in create_pandas_dataframe_agent in langchain?
I'm trying to create a create_pandas_dataframe_agent using custom tools but it's not working.
I'm trying this code:
class callStaf(BaseModel):
def run(self, keyword):
return {"status": "submitted", "staff name": "abcd-xxx-x... | https://stackoverflow.com/questions/76867963/how-to-create-a-custom-tool-in-create-pandas-dataframe-agent-in-langchain | python, pandas, langchain, large-language-model | 1,691,585,406 |
se_79724288 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is there a way to refactor a Maven submodule's pom.xml to be completely "standalone" from its parent? | Is there a way to refactor a Maven submodule's pom.xml to be completely "standalone" from its parent?
I'm conducting a study in which I'm examining how effective LLMs are at translating code between frameworks. Here is one of the datasets I'm using to test this: https://github.com/eclipse-ee4j/jakartaee-... | https://stackoverflow.com/questions/79724288/is-there-a-way-to-refactor-a-maven-submodules-pom-xml-to-be-completely-standal | java, docker, maven, migration, large-language-model | 1,754,250,764 |
se_79040747 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Qwen 2.5 7B randomly hangs for 67 minutes when called using Ollama while running on EC2 Instance | Qwen 2.5 7B randomly hangs for 67 minutes when called using Ollama while running on EC2 Instance
I have Qwen 2.5 7B installed on an EC2 instance - currently a C7i.8Xlarge - and am running a series of data driven prompts through it. The variables from the prompts are pulled from a dataframe. I am using Ollama invoke t... | https://stackoverflow.com/questions/79040747/qwen-2-5-7b-randomly-hangs-for-67-minutes-when-called-using-ollama-while-running | large-language-model, ollama | 1,727,723,403 |
se_79712412 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Fine-tuned Qwen2.5-7B model loops infinitely in Ollama but works fine with transformers | Fine-tuned Qwen2.5-7B model loops infinitely in Ollama but works fine with transformers
I'm experiencing an infinite looping issue with a fine-tuned Qwen2.5-7B model (using unslloth) when running it through Ollama, while the same model works perfectly when tested directly with the transformers library.
Setup Details
B... | https://stackoverflow.com/questions/79712412/fine-tuned-qwen2-5-7b-model-loops-infinitely-in-ollama-but-works-fine-with-trans | large-language-model, ollama | 1,753,295,168 |
se_79716660 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Model Summary not picking up from Codebert model | Model Summary not picking up from Codebert model
I am fine tuning a CodeBert Model using my custom Dataset and Tokenizers. I tried to unfreeze the last 4 layers of the model. When checking if the layers are unfrozen it shows me which layers are not frozen. Following is the code that I am using.
def create_model(
b... | https://stackoverflow.com/questions/79716660/model-summary-not-picking-up-from-codebert-model | python, machine-learning, large-language-model, bert-language-model | 1,753,646,480 |
se_79703405 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Running a Flask python Function give me : 'str' object has no attribute 'copy' | Running a Flask python Function give me : 'str' object has no attribute 'copy'
I'm working with a LLM project where i have a PDF file that is being processed with LamaIndexParse , when i upload the file the api for parsing works fine then the server print the error :
INFO:processing:Stored 6 chunks for... | https://stackoverflow.com/questions/79703405/running-a-flask-python-function-give-me-str-object-has-no-attribute-copy | python, large-language-model | 1,752,668,650 |
se_79717861 | stackoverflow | ARTIFICIAL_INTELLIGENCE | TypeError: 'NoneType' object is not iterable when using ChatHuggingFace with TinyLlama/TinyLlama-1.1B-Chat-v1.0 in LangChain | TypeError: 'NoneType' object is not iterable when using ChatHuggingFace with TinyLlama/TinyLlama-1.1B-Chat-v1.0 in LangChain
I'm trying to use the TinyLlama/TinyLlama-1.1B-Chat-v1.0 model from Hugging Face with LangChain using the langchain_huggingface integration. My goal is to get a simple response from the ... | https://stackoverflow.com/questions/79717861/typeerror-nonetype-object-is-not-iterable-when-using-chathuggingface-with-tin | python, huggingface-transformers, langchain, large-language-model, huggingface | 1,753,735,361 |
se_79711007 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LangChain FAISS similarity_search returns empty list despite populated index | LangChain FAISS similarity_search returns empty list despite populated index
I’m trying to use LangChain with FAISS to build a simple document retriever. I’ve indexed several documents, but when I call similarity_search, I always get an empty list.
from langchain.embeddings.openai import OpenAIEmbeddings
from langchai... | https://stackoverflow.com/questions/79711007/langchain-faiss-similarity-search-returns-empty-list-despite-populated-index | python, large-language-model, py-langchain, retrieval-augmented-generation | 1,753,215,587 |
se_79566923 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to access state from LangGraph inside a tool in a react agent or OpenAI Tool Agent? | How to access state from LangGraph inside a tool in a react agent or OpenAI Tool Agent?
I'm using LangGraph along with a react agent in LangChain to create an agent that can execute tools (Tools).
I need to access the state from LangGraph inside a tool, or at least be able to pass variables like user_id to the agent s... | https://stackoverflow.com/questions/79566923/how-to-access-state-from-langgraph-inside-a-tool-in-a-react-agent-or-openai-tool | python, langchain, large-language-model, agent, langgraph | 1,744,294,966 |
se_79702358 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AWS SageMaker - Custom Inference With HuggingFace Model | AWS SageMaker - Custom Inference With HuggingFace Model
For context, I'm currently working in a JupyterLab space in SageMaker studio.
My goal is to deploy a HuggingFace Llama model for batch transform inference. The data I will be passing in to the LLM is in an S3 bucket in the same AWS account. The data does require ... | https://stackoverflow.com/questions/79702358/aws-sagemaker-custom-inference-with-huggingface-model | python, amazon-web-services, machine-learning, amazon-sagemaker, large-language-model | 1,752,596,259 |
se_79709658 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Postgresql MCP server not running. Tool showing error | Postgresql MCP server not running. Tool showing error
Here is the code I am running for mcp-server on cursor -
from contextlib import asynccontextmanager
from collections.abc import AsyncIterator
from dataclasses import dataclass
import asyncpg
from mcp.server.fastmcp import FastMCP, Context
# Async PostgreSQL wrapp... | https://stackoverflow.com/questions/79709658/postgresql-mcp-server-not-running-tool-showing-error | python, postgresql, large-language-model, model-context-protocol, claude | 1,753,133,502 |
se_79362899 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Where are LangChain's chat templates stored? | Where are LangChain's chat templates stored?
You know how when you use chains or agents, LangChain automatically adds all the necessary chat templates?
Well, I decided to look for them, to see how they actually look. But, I could not find them anywhere.
In fact, even when I searched the special tokens directly on ... | https://stackoverflow.com/questions/79362899/where-are-langchains-chat-templates-stored | artificial-intelligence, prompt, langchain, large-language-model, huggingface | 1,737,057,120 |
se_79708270 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Adding EarlyStopping() to transformers Trainer() error | Adding EarlyStopping() to transformers Trainer() error
I'm using this code for fine-tuning a LoRA model:
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.float16,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
)
model = AutoModelForCausalLM.from_pretra... | https://stackoverflow.com/questions/79708270/adding-earlystopping-to-transformers-trainer-error | python, huggingface-transformers, large-language-model | 1,753,035,620 |
se_79683781 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Getting StopIteration or No Output while using HuggingFace InferenceClient with TinyLlama / Falcon models | Getting StopIteration or No Output while using HuggingFace InferenceClient with TinyLlama / Falcon models
I'm trying to run text generation using the Hugging Face InferenceClient in Python, but I keep getting either a StopIteration error or no output at all. Here's my setup:
from huggingface_hub import InferenceClient... | https://stackoverflow.com/questions/79683781/getting-stopiteration-or-no-output-while-using-huggingface-inferenceclient-with | python, pytorch, huggingface-transformers, langchain, large-language-model | 1,751,204,523 |
se_79706678 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to conditionally include a variable in a @UserMessage prompt in LangChain4j (skip if null)? | How to conditionally include a variable in a @UserMessage prompt in LangChain4j (skip if null)?
I'm using LangChain4j to define prompts using @UserMessage annotations, like this:
@UserMessage(
"The alert is described as follows: {{description}}\n\n"
+ "HTTP response evidence:\n---\n{{evidence}}\n---\n"
+ "Addi... | https://stackoverflow.com/questions/79706678/how-to-conditionally-include-a-variable-in-a-usermessage-prompt-in-langchain4j | java, langchain, large-language-model, langchain4j | 1,752,868,181 |
se_79690354 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to replace unescaped double quote in string list | How to replace unescaped double quote in string list
I have an output from the LLM call, which includes a string list. But the LLM is not smart enough to escape the double quote (") in the string, which will cause the json.loads error. How could I replace the double quote (") with (\") so that the json.loads can run w... | https://stackoverflow.com/questions/79690354/how-to-replace-unescaped-double-quote-in-string-list | regex, escaping, large-language-model | 1,751,639,937 |
se_79385136 | stackoverflow | ARTIFICIAL_INTELLIGENCE | PandasAI give exactly the same result with different models | PandasAI give exactly the same result with different models
I use the titanic dataset (https://www.kaggle.com/datasets/yasserh/titanic-dataset) and want to use LLM for the data exploration.
I use pandasai with OpenAI and local model and find that the responses are exactly the same.
Is it really possible?
# ChatGPT
fro... | https://stackoverflow.com/questions/79385136/pandasai-give-exactly-the-same-result-with-different-models | large-language-model, pandasai, pandas-ai | 1,737,739,048 |
se_79695488 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Trained Huggingface EncoderDecoderModel.generate() produces only bos-tokens | Trained Huggingface EncoderDecoderModel.generate() produces only bos-tokens
I am working on a Huggingface transformers EncoderDecoderModel consisting of a frozen BERT-Encoder (answerdotai-ModernBERT-base) and a trainable GPT2-Decoder. Due to the different architectures for Encoder and Decoder, both come with different... | https://stackoverflow.com/questions/79695488/trained-huggingface-encoderdecodermodel-generate-produces-only-bos-tokens | python, deep-learning, pytorch, huggingface-transformers, large-language-model | 1,752,058,070 |
se_79678678 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to implement context-aware tool routing with local models like Ollama? | How to implement context-aware tool routing with local models like Ollama?
I'm using a locally hosted model(llama3.2) with Ollama and trying to replicate functionality similar to bind_tools(to create and run the tools with LLM ) for tool calling.
This is my model service
from src.config.settings import settings
from l... | https://stackoverflow.com/questions/79678678/how-to-implement-context-aware-tool-routing-with-local-models-like-ollama | python, large-language-model, llama3, generative-pretrained-transformer | 1,750,839,037 |
se_79458699 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Problem in dynamicCache: index -1 is out of bounds for dimension 0 with size 0 in cache_position[-1] | Problem in dynamicCache: index -1 is out of bounds for dimension 0 with size 0 in cache_position[-1]
I am trying to use DynamicCache with an input prompt. After caching the prompt, I want to generate one output at a time (and append it to the previous prompt) and generate again. I am running the following code (exampl... | https://stackoverflow.com/questions/79458699/problem-in-dynamiccache-index-1-is-out-of-bounds-for-dimension-0-with-size-0-i | caching, huggingface-transformers, large-language-model | 1,740,174,749 |
se_79699359 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Custom NER to extract header, request and response from API document | Custom NER to extract header, request and response from API document
I'm trying to extract API integration parameters like Authorization headers, query params, and request body fields from API documentation. This is essentially a custom NER task.
I’ve experimented with LLaMA 3.1 and Mistral using Ollama, but both run ... | https://stackoverflow.com/questions/79699359/custom-ner-to-extract-header-request-and-response-from-api-document | nlp, large-language-model, mistral-7b, llama3, api-documentation | 1,752,331,348 |
se_79687355 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to make the LLM call MCP functions hosted on Google Cloud Run with Python | How to make the LLM call MCP functions hosted on Google Cloud Run with Python
I have hosted a function on Google Could run and am able to call it with FastMCPClient.
Thank you for the help with my earlier question.
This is my MCP Server code. This is deployed as a docker image on Google Cloud Run.
import asyncio
impor... | https://stackoverflow.com/questions/79687355/how-to-make-the-llm-call-mcp-functions-hosted-on-google-cloud-run-with-python | python, https, google-cloud-run, large-language-model, model-context-protocol | 1,751,456,475 |
se_79614552 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Use Letta's Archival Memory in Python SDK? | How to Use Letta's Archival Memory in Python SDK?
I'm developing an AI-powered webpage builder using a large language model (LLM). To maintain consistency across webpage components, the agent needs to remember previously generated components. Given the context window limitations of LLMs, I explored Letta for its e... | https://stackoverflow.com/questions/79614552/how-to-use-lettas-archival-memory-in-python-sdk | python-3.x, contextmenu, large-language-model | 1,746,809,239 |
se_79680987 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Chainlit <> Mermaid Rendering Issue | Chainlit <> Mermaid Rendering Issue
I am creating a Chainlit app, and instructing the model to provide some Mermaid diagrams as well.
I am instructing the model to give the diagrams in this way in the system prompt,
system_prompt = """
...
...
### Mermaid Diagram Format:
Always wrap Mermaid code in triple backti... | https://stackoverflow.com/questions/79680987/chainlit-mermaid-rendering-issue | python, openai-api, streamlit, large-language-model, chainlit | 1,750,961,362 |
se_79681038 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Language Model Evaluation with Custom Task - Hugging Face Lighteval | Language Model Evaluation with Custom Task - Hugging Face Lighteval
I am creating a benchmark to evaluate a language model. First, I generated the dataset that I'm gonna prompt the Language model with. Subsequently, I tried to evaluate any tiny language model just to get a end-to-end small functioning app. I followed ... | https://stackoverflow.com/questions/79681038/language-model-evaluation-with-custom-task-hugging-face-lighteval | python, machine-learning, nlp, large-language-model, huggingface | 1,750,964,642 |
se_79578894 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can I create one VECTOR INDEX for multiple labels (e.g. Movie and Person)? | Can I create one VECTOR INDEX for multiple labels (e.g. Movie and Person)?
I'm on Neo4j 5.27 (community) and want to index the same property (say embedding) across two different node types—Movie and Person—with a single vector index. I’ve tried:
CREATE VECTOR INDEX multiLabelIndex
IF NOT EXISTS
FOR (n:Movie|Person) ON... | https://stackoverflow.com/questions/79578894/can-i-create-one-vector-index-for-multiple-labels-e-g-movie-and-person | neo4j, large-language-model | 1,744,881,489 |
se_79335247 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Slow Response Time in Cricket-Specific Chatbot Using CrewAI | Slow Response Time in Cricket-Specific Chatbot Using CrewAI
I’m building a cricket-specific chatbot using CrewAI. The chatbot is designed to answer queries based on historical cricket data in CSV files and real-time data from APIs. The data is stored in an SQL database. However, I am experiencing slow response times f... | https://stackoverflow.com/questions/79335247/slow-response-time-in-cricket-specific-chatbot-using-crewai | chatbot, large-language-model, crewai | 1,736,236,997 |
se_78347994 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What is the easiest way of converting json to vector database | What is the easiest way of converting json to vector database
I need to convert a json file to vector database. I use chromadb.
collection.add(
documents=["This is a document", "This is another document"],
metadatas=[{"source": "my_source"}, {"source": "my_source"}],
ids=["id1", "id2"]
)
This code is used... | https://stackoverflow.com/questions/78347994/what-is-the-easiest-way-of-converting-json-to-vector-database | python, nlp, large-language-model, vector-database | 1,713,448,463 |
se_79526074 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Ollama model keep in memory and prevent unloading between requests (keep_alive?) | Ollama model keep in memory and prevent unloading between requests (keep_alive?)
No matter what I do from the terminal or in code, the agent requests to Ollama models take 15–25 seconds each time on my local M2 MacBook Pro.
I am pretty sure this is not a hardware issue because the model is lightning fast when used fro... | https://stackoverflow.com/questions/79526074/ollama-model-keep-in-memory-and-prevent-unloading-between-requests-keep-alive | python, large-language-model, ollama | 1,742,574,577 |
se_79358392 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do I setup a python code to access llama 3.3 model | How do I setup a python code to access llama 3.3 model
I have installed llama 3.3 on remote GPU using these commands.
curl -fsSL https://ollama.com/install.sh | sh
ollama run llama3.3
I need to run the following code which uses the llama3.3 installed on the machine.
import transformers
import torch
model_id = "meta-... | https://stackoverflow.com/questions/79358392/how-do-i-setup-a-python-code-to-access-llama-3-3-model | large-language-model, llama, ollama | 1,736,947,510 |
se_79605566 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ollama.generate raises model not found error: "hf.co/mradermacher/Llama-3.2-3B-Instruct-uncensored-GGUF" | ollama.generate raises model not found error: "hf.co/mradermacher/Llama-3.2-3B-Instruct-uncensored-GGUF"
I'm trying to run a Python script that uses the ollama library to generate responses from a custom LLM model. My code attempts to call ollama.generate() using the following model name:
chosen_model = 'hf.... | https://stackoverflow.com/questions/79605566/ollama-generate-raises-model-not-found-error-hf-co-mradermacher-llama-3-2-3b-i | python, large-language-model, huggingface, ollama, language-model | 1,746,358,347 |
se_79672988 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why can't (langchain) AzureOpenAI find a model that AzureChatOpenAI can? | Why can't (langchain) AzureOpenAI find a model that AzureChatOpenAI can?
Invoking a request using AzureChatOpenAI returns response as expected:
import os
from dotenv import load_dotenv
from langchain_openai import AzureChatOpenAI
load_dotenv()
llm = AzureChatOpenAI(
azure_endpoint=os.getenv("AZURE_ENDPOINT")... | https://stackoverflow.com/questions/79672988/why-cant-langchain-azureopenai-find-a-model-that-azurechatopenai-can | python, langchain, large-language-model, azure-openai | 1,750,403,860 |
se_79674172 | stackoverflow | ARTIFICIAL_INTELLIGENCE | PyTorch CUDA Out of Memory in Graph Generation | PyTorch CUDA Out of Memory in Graph Generation
In my project I use pytorch to deploy a customed llm inference. In generation step I use torch.cuda.graph to reduce the CPU overhead since the implement of this llm is quite naive torch-version.
In short I slice the total max output token length to several steps, each st... | https://stackoverflow.com/questions/79674172/pytorch-cuda-out-of-memory-in-graph-generation | pytorch, large-language-model | 1,750,483,003 |
se_79674193 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why doesn't PDF caching speed up/match raw text input latency on Gemini API? | Why doesn't PDF caching speed up/match raw text input latency on Gemini API?
Passing the text from OCR on a PDF is much faster than using the cache. Why?
Passing raw text, Nth call takes ~2 seconds.
response = client.models.generate_content(
model=MODEL_NAME,
contents=f"{document_text} {prompt}")
Since I don'... | https://stackoverflow.com/questions/79674193/why-doesnt-pdf-caching-speed-up-match-raw-text-input-latency-on-gemini-api | caching, large-language-model, latency, google-gemini, google-gemini-file-api | 1,750,485,648 |
se_79673021 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unable to run code to invoke Bedrock Model | Unable to run code to invoke Bedrock Model
I am trying to run this code to validate my access to a Bedrock model
import boto3
import json
bedrock_runtime = boto3.client("bedrock-runtime", region_name="us-east-2")
response = bedrock_runtime.invoke_model(
#modelId="anthropic.claude-3-sonnet-20240229-v1:0",
mo... | https://stackoverflow.com/questions/79673021/unable-to-run-code-to-invoke-bedrock-model | python, large-language-model, amazon-bedrock | 1,750,405,838 |
se_79672922 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AttributeError: 'LlmAgent' object has no attribute 'invoke' | AttributeError: 'LlmAgent' object has no attribute 'invoke'
I am trying to call Flask API which i alrady running on port 5000 on my system, i am desgning a agentic AI code which will invoke GET and then POSt based on some condition , and using google-adk. I have below code
import requests
from google.a... | https://stackoverflow.com/questions/79672922/attributeerror-llmagent-object-has-no-attribute-invoke | python, artificial-intelligence, large-language-model, agent, rag | 1,750,400,312 |
se_79541342 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Google Gemini not calling the tools | Google Gemini not calling the tools
I am new to AI Agents and developing one. I am using Google gemini-2.0-flash and attached the LLM to some tools but LLM response is not consistent. Sometimes it calls the tools and sometimes it doesn't.
Has anyone faced this issue before? I fell like LLM may be caching the response ... | https://stackoverflow.com/questions/79541342/google-gemini-not-calling-the-tools | python, large-language-model, google-gemini, langgraph | 1,743,162,503 |
se_79637060 | stackoverflow | ARTIFICIAL_INTELLIGENCE | HfHubHTTPError when calling DoclingLoader with a pdf file | HfHubHTTPError when calling DoclingLoader with a pdf file
I have installed docling successfully, but when doing the following:
from langchain_docling import DoclingLoader
source_path = "shared\abc.pdf"
loader = DoclingLoader(file_path=source_path)
It shows the following error:
HTTPError: 401 Client Error: Unauthorize... | https://stackoverflow.com/questions/79637060/hfhubhttperror-when-calling-doclingloader-with-a-pdf-file | large-language-model, huggingface, pdf-reader, huggingface-hub | 1,748,110,934 |
se_79652485 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Receiving a 400 error when calling Azure OpenAI Python SDK Response.create | Receiving a 400 error when calling Azure OpenAI Python SDK Response.create
I'm running an Azure Responses call using the Azure Python SDK:
from openai import AzureOpenAI
.
.
.
self.client = AzureOpenAI(
api_key=config.get("api_key"),
base_url= config.get("endpoint"),
api_version= "2025-04-01-preview"
)
.
.... | https://stackoverflow.com/questions/79652485/receiving-a-400-error-when-calling-azure-openai-python-sdk-response-create | python, azure, large-language-model, azure-openai | 1,749,029,279 |
se_78758379 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ImageBind LLM checkpoint | ImageBind LLM checkpoint
I want to use imagebind llm model for my task, but I can not import llama and find out the checkpoints for ImageBind-LLM.
I installed all required packages and followed readme instruction on github to process imagebind llm, but it still has errors in my image.
here is github link of imagebind | https://stackoverflow.com/questions/78758379/imagebind-llm-checkpoint | large-language-model | 1,721,204,289 |
se_77440953 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LLM Question answer models for yes or no answers | LLM Question answer models for yes or no answers
imagine I have the following dataset:
import pandas as pd
# Positive and negative sentences
positive_sentences = [
"I love this product!",
"The weather is beautiful today.",
"The team did an excellent job.",
"She is a very talented musician."
]
negativ... | https://stackoverflow.com/questions/77440953/llm-question-answer-models-for-yes-or-no-answers | nlp, huggingface-transformers, large-language-model, nlp-question-answering | 1,699,385,289 |
se_78766873 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unable to import SentenceTransformer | Unable to import SentenceTransformer
I am using Colab, I am trying to import SentenceTransformer:
from sentence_transformers import SentenceTransformer
However, I got this error:
ttributeError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/transformers/utils/impor... | https://stackoverflow.com/questions/78766873/unable-to-import-sentencetransformer | tensorflow, large-language-model, embedding, sentence-transformers | 1,721,341,482 |
se_79646896 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Embeddings show as a list of a list | Embeddings show as a list of a list
I am trying to build a Rage Pipeline for a dataset containing 100 coffee shops in LA. The goal is to use the column Combined Review Text to recommend different coffee shops to the users. The goal is to create the rag pip-line, build a flask app in order to containerize it and deploy... | https://stackoverflow.com/questions/79646896/embeddings-show-as-a-list-of-a-list | python, flask, large-language-model, google-gemini | 1,748,717,213 |
se_79657478 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LLM reinforcement learning by inserting custom reward function into PPOTrainer in TRL library | LLM reinforcement learning by inserting custom reward function into PPOTrainer in TRL library
I wanted to do reinforcement learning with LLM as a reward function I made (RLHF), so I looked up examples, but I haven't found a suitable one yet.
So, using GPT, we used TRL to create a simple PPO example that simply deliver... | https://stackoverflow.com/questions/79657478/llm-reinforcement-learning-by-inserting-custom-reward-function-into-ppotrainer-i | large-language-model | 1,749,353,634 |
se_79502509 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Difference between TfIdf vectorizer and kwx | Difference between TfIdf vectorizer and kwx
I am looking at querying a text database based on keywords and getting the relevant chunks. I want to know what is the difference between python's kwx package and sklearn's tfidfvectoriser in implementing this. Even though kwx extracts keywords and topics, looks like I can't... | https://stackoverflow.com/questions/79502509/difference-between-tfidf-vectorizer-and-kwx | nlp, large-language-model, tf-idf, tfidfvectorizer, keyword-search | 1,741,745,999 |
se_79647185 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Llama_cookbook: why are labels not shifted for CausalLM? | Llama_cookbook: why are labels not shifted for CausalLM?
I'm studying the llama_cookbok repo, in particular their finetuning example.
This example uses LlamaForCausalLM model and samsum_dataset (input: dialog, output: summary). Now, looking at how they process the dataset, if we look at the "labels" part:
For prompt ... | https://stackoverflow.com/questions/79647185/llama-cookbook-why-are-labels-not-shifted-for-causallm | python, large-language-model, llama, attention-model, fine-tuning | 1,748,752,142 |
se_79430117 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to extract tables from a PDF and convert them into structured HTML (<table>, <tr>, <td>) while maintaining the original layout and formatting? | How to extract tables from a PDF and convert them into structured HTML (<table>, <tr>, <td>) while maintaining the original layout and formatting?
1]Original page of Doc1 contain 4 tables
1]Output .html page of Doc1 not detecting table properly,sometimes extracting text from table as plain text
2]Ori... | https://stackoverflow.com/questions/79430117/how-to-extract-tables-from-a-pdf-and-convert-them-into-structured-html-table | python, machine-learning, deep-learning, langchain, large-language-model | 1,739,280,110 |
se_79650791 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Custom embedder and Custom knowledge source in CrewAI - getting KeyError: 'OPENAI_API_KEY' | Custom embedder and Custom knowledge source in CrewAI - getting KeyError: 'OPENAI_API_KEY'
I have setup a Custom Embedder to use with knowledge and tools, but keep getting the error:
litellm.AuthenticationError: AuthenticationError: OpenAIException -
The api_key client option must be set either by passing api... | https://stackoverflow.com/questions/79650791/custom-embedder-and-custom-knowledge-source-in-crewai-getting-keyerror-opena | python, postgresql, vector, large-language-model, crewai | 1,748,935,529 |
se_79650011 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Scaling RAG QA with Large Docs, Tables, and 30K+ Chunks (No LangChain) | Scaling RAG QA with Large Docs, Tables, and 30K+ Chunks (No LangChain)
I'm building a RAG-based document QA system using Python (no LangChain), LLaMA (50K context), PostgreSQL with pgvector, and Docling for parsing. Users can upload up to 10 large documents (300+ pages each), often containing numerous tables and chart... | https://stackoverflow.com/questions/79650011/scaling-rag-qa-with-large-docs-tables-and-30k-chunks-no-langchain | python, document, large-language-model, chunking, rag | 1,748,881,837 |
se_79065125 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I get LangChain stream data without logs? | How can I get LangChain stream data without logs?
I am using LangChain and Cohere. It works fine whenever I used invoke with agent executor, but whenever I moved for streaming and using astream_events I got extra data along with the response. The following is my sample code and response.
agent_executor = AgentExec... | https://stackoverflow.com/questions/79065125/how-can-i-get-langchain-stream-data-without-logs | python-3.x, large-language-model, py-langchain | 1,728,377,874 |
se_79068298 | stackoverflow | ARTIFICIAL_INTELLIGENCE | valueError: Supplied state dict for layers does not contain `bitsandbytes__*` and possibly other `quantized_stats`(when load saved quantized model) | valueError: Supplied state dict for layers does not contain `bitsandbytes__*` and possibly other `quantized_stats`(when load saved quantized model)
We are trying to deploy a quantized Llama 3.1 70B model(from Huggingface, using bitsandbytes), quantizing part works fine as we check the model memory which is correct and... | https://stackoverflow.com/questions/79068298/valueerror-supplied-state-dict-for-layers-does-not-contain-bitsandbytes-an | python, artificial-intelligence, huggingface-transformers, large-language-model, quantization | 1,728,440,728 |
se_79645584 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error using @Tool Annotation in Kotlin with quarkus LangChain4J | Error using @Tool Annotation in Kotlin with quarkus LangChain4J
I tried to develop a basic assistant and expose it as a tool in Kotlin, following the examples shown in:
quarkus agentic ai
step by step.
However, when I try to use the @Tool annotation in my Kotlin interface
package prova.langchainkotlin
import dev.lang... | https://stackoverflow.com/questions/79645584/error-using-tool-annotation-in-kotlin-with-quarkus-langchain4j | kotlin, quarkus, large-language-model, langchain4j | 1,748,613,400 |
se_79640246 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to handle negative search queries in a vector similarity search query? | How to handle negative search queries in a vector similarity search query?
I'm working with a vector database (qdrant) and using semantic search via embeddings (Sentence Transformers).
My use case involves queries like:
"Give animals other than cats"
or
"List inventions except electrical ones"
Since vector search is b... | https://stackoverflow.com/questions/79640246/how-to-handle-negative-search-queries-in-a-vector-similarity-search-query | python, vector, large-language-model, word-embedding, vector-search | 1,748,340,242 |
se_79479963 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to include image as part of user prompt in haystack 2.X? | How to include image as part of user prompt in haystack 2.X?
I have a great pipeline of chatbot using Haystack. I am referring to the haystack docs to create a pipeline, here is the example of the pipeline using prompt builder:
from haystack import Pipeline
from haystack.utils import Secret
from haystack.components.re... | https://stackoverflow.com/questions/79479963/how-to-include-image-as-part-of-user-prompt-in-haystack-2-x | python, openai-api, large-language-model, haystack, multimodal | 1,740,961,793 |
se_79639986 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is it possible to fine-tune an LLM using LoRA on AWS ECS Fargate? | Is it possible to fine-tune an LLM using LoRA on AWS ECS Fargate?
I’m trying to fine-tune a lightweight LLM (like TinyLlama) using LoRA for a small custom dataset, but I'm facing two major issues:
Problem 1:
When I fine-tune the model locally, I’m unable to push the fine-tuned model folder (checkpoints, adapter weight... | https://stackoverflow.com/questions/79639986/is-it-possible-to-fine-tune-an-llm-using-lora-on-aws-ecs-fargate | amazon-web-services, data-science, large-language-model, aws-fargate | 1,748,330,587 |
se_79638902 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What should I set as LoRA target_modules for each stage of continued pretraining on Qwen2.5-VL-Instruct using Unsloth? | What should I set as LoRA target_modules for each stage of continued pretraining on Qwen2.5-VL-Instruct using Unsloth?
I would like to perform continued pretraining of Qwen2.5-VL-Instruct using Unsloth + LoRA, following a three-stage training process:
Stage 1: Train only the projector (Alignment)
Stage 2: Train both ... | https://stackoverflow.com/questions/79638902/what-should-i-set-as-lora-target-modules-for-each-stage-of-continued-pretraining | python, nlp, huggingface-transformers, large-language-model, peft | 1,748,262,346 |
se_79593241 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to re-use attention in huggingface | How to re-use attention in huggingface
I have a long chunk of text that I need to process using a transformer, I would then like to have users ask different questions about it (all questions are independent, they don't relate to each other)
The input always looks like this:
...
< LONG TEXT, always the same >
...
< US... | https://stackoverflow.com/questions/79593241/how-to-re-use-attention-in-huggingface | huggingface-transformers, large-language-model, huggingface, llama | 1,745,611,704 |
se_79034745 | stackoverflow | ARTIFICIAL_INTELLIGENCE | how to do caching of initial prompts in langchain for a sql based chatbot | how to do caching of initial prompts in langchain for a sql based chatbot
I am creating a chatbot application using Langchain/Ollama and Gemma2b. The application is working fine, but now I am stuck on speed optimizations.
With every request, I send the schema of the database, a few-shot examples retrieved from the dat... | https://stackoverflow.com/questions/79034745/how-to-do-caching-of-initial-prompts-in-langchain-for-a-sql-based-chatbot | langchain, large-language-model | 1,727,542,739 |
se_79630930 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unsloth doesn't find Llama.cpp to convert fine-tuned LLM to GGUF | Unsloth doesn't find Llama.cpp to convert fine-tuned LLM to GGUF
I am executing on an Azure VM this notebook from the Unsloth docs:
https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Llama3_(8B)-Ollama.ipynb
Where in the end they save the model to GGUF format after fine-tuning like this:
mod... | https://stackoverflow.com/questions/79630930/unsloth-doesnt-find-llama-cpp-to-convert-fine-tuned-llm-to-gguf | python, huggingface-transformers, large-language-model, fine-tuning, llamacpp | 1,747,762,996 |
se_79635491 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Ollama total_duration is bigger than load_duration + prompt_eval_duration + eval_duration | Ollama total_duration is bigger than load_duration + prompt_eval_duration + eval_duration
I am implementing a service to analyze big documents.
When query Ollama server I get a difference (of more than 5 seconds) between the "total duration" and the sum of load_duration + prompt_eval_duration + eval_duration, as seen ... | https://stackoverflow.com/questions/79635491/ollama-total-duration-is-bigger-than-load-duration-prompt-eval-duration-eval | docker, large-language-model, ollama | 1,748,002,981 |
se_78115102 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Context Window LLM | Context Window LLM
I would like to know how the context window works in Rag
for example:
GPT3 2048 tokens
GPT4 8192 to 32768 tokens
in the gpt3 example in the documents we will have a window of 2048 forward and 2048 backward?
Does this mean it can only recover within that window?
explanation of how the context window ... | https://stackoverflow.com/questions/78115102/context-window-llm | large-language-model, google-generativeai | 1,709,734,613 |
se_79130919 | stackoverflow | ARTIFICIAL_INTELLIGENCE | SemanticKernel function call with local LLM issue | SemanticKernel function call with local LLM issue
I am trying to create my first demo AI project, and I would like to use Semantic Kernel to connect with my local hosted LLM and use function calls. I am getting responses from the LLM just fine, but I am unable to invoke any of my plugins. I can see that plugins are in... | https://stackoverflow.com/questions/79130919/semantickernel-function-call-with-local-llm-issue | .net, large-language-model, semantic-kernel, semantic-kernel-plugins | 1,730,044,034 |
se_76873456 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ERROR: The prompt size exceeds the context window size and cannot be processed | ERROR: The prompt size exceeds the context window size and cannot be processed
I have been trying to create a document QA chatbot using GPT4ALL as the llm and hugging face's instructor-large model for embedding. I was able to create the index, but getting the following as a response, it's not really an error which I'm... | https://stackoverflow.com/questions/76873456/error-the-prompt-size-exceeds-the-context-window-size-and-cannot-be-processed | langchain, huggingface, large-language-model, llama-index, gpt4all | 1,691,652,204 |
se_79632374 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get full, raw, serialized prompt that is sent to LLM using Instructor | How to get full, raw, serialized prompt that is sent to LLM using Instructor
My question is specifically for use with the Python Instructor library. Is there a way to get the full, raw, serialized prompt that is sent to an the LLM? I saw that this has come up before in this issue. The response says to use hooks, but I... | https://stackoverflow.com/questions/79632374/how-to-get-full-raw-serialized-prompt-that-is-sent-to-llm-using-instructor | python, pydantic, large-language-model, google-gemini | 1,747,843,935 |
se_79629810 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Very slow inference using LLAVA with LLama.cpp vs LM Studio | Very slow inference using LLAVA with LLama.cpp vs LM Studio
I'm looking for help understanding how to correctly query LLaVA models via llama.cpp.
(Note: I had to remove direct links to not have the post auto deleted)
Here’s what I’ve done so far:
I downloaded the CUDA release suited to my setup:
GPU: NVIDIA GeForce ... | https://stackoverflow.com/questions/79629810/very-slow-inference-using-llava-with-llama-cpp-vs-lm-studio | large-language-model, llamacpp | 1,747,717,697 |
se_79626470 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Getting StopIteration error in HuggingFace | Getting StopIteration error in HuggingFace
I am using Colab and HuggingFace Token is added in Colab secrets.
from langchain_huggingface import ChatHuggingFace, HuggingFaceEndpoint
from dotenv import load_dotenv
from google.colab import userdata
import os
print("Before try block:", 'hf_token' in locals())
# Initialize... | https://stackoverflow.com/questions/79626470/getting-stopiteration-error-in-huggingface | python, langchain, large-language-model, huggingface | 1,747,481,007 |
se_78846880 | stackoverflow | ARTIFICIAL_INTELLIGENCE | huggingface train only new tokens embedding | huggingface train only new tokens embedding
I want to add new tokens to a huggingface model and train only their embeddings. How can I do that?
There are some ways to train only part of a weight tensor (e.g. https://discuss.pytorch.org/t/how-can-i-freeze-weights-in-element-wise/117988), however they seem to have acces... | https://stackoverflow.com/questions/78846880/huggingface-train-only-new-tokens-embedding | python, pytorch, large-language-model, word-embedding, huggingface | 1,723,099,650 |
se_79598006 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Embedding model `all-mpnet-base-v2` not able to classify user prompt properly | Embedding model `all-mpnet-base-v2` not able to classify user prompt properly
I am using this model to embed a product catalog for a rag. In the product catalog, there are no red shirts for men, but there are red shirts for women. How can I make sure the model doesnt output women shirts for men based queries?
The foll... | https://stackoverflow.com/questions/79598006/embedding-model-all-mpnet-base-v2-not-able-to-classify-user-prompt-properly | large-language-model, sentence-transformers, sentence-similarity, rag | 1,745,918,197 |
se_79479503 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Assistant: Error: fake_search is not a valid tool, try one of [tool] | Assistant: Error: fake_search is not a valid tool, try one of [tool]
I can't figure out how to use a custom function as a tool with langgraph + ChatOpenAI and Ollama. The "TavilySearchResults" and "DuckDuckGoSearchResults" community tools work fine, but even the simplest custom function produces an error Assistant: E... | https://stackoverflow.com/questions/79479503/assistant-error-fake-search-is-not-a-valid-tool-try-one-of-tool | langchain, large-language-model, py-langchain, ollama, langgraph | 1,740,938,604 |
se_79598568 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Asynchronous multi-client Hugging Face inference server without blocking GPU utilization | Asynchronous multi-client Hugging Face inference server without blocking GPU utilization
I'm building a local inference server that handles multiple user requests concurrently on a single GPU.
Each user sends a prompt to a Hugging Face model (e.g., Llama-2, Mistral, Falcon).
However, I noticed that:
Running one large... | https://stackoverflow.com/questions/79598568/asynchronous-multi-client-hugging-face-inference-server-without-blocking-gpu-uti | python, tensorflow, huggingface-transformers, large-language-model | 1,745,935,644 |
se_79607906 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can we use one base language model for `create_react_agent()` and different models for the tools? | Can we use one base language model for `create_react_agent()` and different models for the tools?
I have the following code block that uses langchain.create_react_agent to create an agent:
movie_chat = prompt | llm | StrOutputParser()
tools = [
Tool.from_function(
name="Movie Chat",
description="Fo... | https://stackoverflow.com/questions/79607906/can-we-use-one-base-language-model-for-create-react-agent-and-different-mode | openai-api, langchain, large-language-model, agent | 1,746,500,717 |
se_79598098 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why is this python code not running under first execution? | Why is this python code not running under first execution?
from transformers import pipeline
summarizer = pipeline("summarization")
result = summarizer(
"""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical... | https://stackoverflow.com/questions/79598098/why-is-this-python-code-not-running-under-first-execution | machine-learning, nlp, artificial-intelligence, huggingface-transformers, large-language-model | 1,745,921,042 |
se_79604935 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to write chat template for llama.cpp? | How to write chat template for llama.cpp?
I am trying to run the llama-cli tool in llama.cpp. However, I am encountering problems when talking to my model codellama-7b-instruct.Q5_K_M.gguf So I decided to use the conversation template. Unfortunately I don't quite know how to do this.
So far the command I have tried to... | https://stackoverflow.com/questions/79604935/how-to-write-chat-template-for-llama-cpp | jinja2, chatbot, large-language-model, llamacpp | 1,746,291,723 |
se_79601335 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Does the outlines python library work in a streaming context yet? | Does the outlines python library work in a streaming context yet?
I have created a fastAPI web interface to a local RAG powered question answer system. I have a local vector database populated with proprietary information.
I first take the user question from the webpage and use it to retrieve results from chroma DB. T... | https://stackoverflow.com/questions/79601335/does-the-outlines-python-library-work-in-a-streaming-context-yet | python, large-language-model, chromadb | 1,746,068,933 |
se_79597244 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to create prompt with /chat endpoint for llama.cpp? | How to create prompt with /chat endpoint for llama.cpp?
I just installed raw llama.cpp to run codellama-7b-instruct.Q5_K_M.gguf. I started it on llama's server but unfortunatly it is responding with really weird answers, which looks like it is trying to simulate its own conversation.
I have tried to use some kind of t... | https://stackoverflow.com/questions/79597244/how-to-create-prompt-with-chat-endpoint-for-llama-cpp | artificial-intelligence, chatbot, endpoint, large-language-model, llamacpp | 1,745,872,004 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.