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_79444743 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to change where OLLAMA models are saved on linux | How to change where OLLAMA models are saved on linux
As far as I understood from https://klu.ai/glossary/ollama, when we download a model through OLLAMA, Ollama models are stored in the ~/.ollama/models directory.
Is there a way to change this default directory, and make OLLAMA read from another directory like ~/proje... | https://stackoverflow.com/questions/79444743/how-to-change-where-ollama-models-are-saved-on-linux | large-language-model, ollama | 1,739,778,757 |
se_77550506 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What is the right way to do system prompting with Ollama in Langchain using Python? | What is the right way to do system prompting with Ollama in Langchain using Python?
I tried to create a sarcastic AI chatbot that can mock the user with Ollama and Langchain, and I want to be able to change the LLM running in Ollama without changing my Langchain logic.
The problem is every LLM seems to have a differen... | https://stackoverflow.com/questions/77550506/what-is-the-right-way-to-do-system-prompting-with-ollama-in-langchain-using-pyth | langchain, large-language-model, mistral-7b | 1,700,974,652 |
se_79435891 | stackoverflow | ARTIFICIAL_INTELLIGENCE | SemanticKernel GetStreamingChatMessageContentsAsync empty but GetChatMessageContentAsync works fine | SemanticKernel GetStreamingChatMessageContentsAsync empty but GetChatMessageContentAsync works fine
I just got started with SemanticKernel on local LLM.
I got it working with the following code:
var chat = app.Services.GetRequiredService<IChatCompletionService>();
ChatMessageContent response = await chat.GetChatMessa... | https://stackoverflow.com/questions/79435891/semantickernel-getstreamingchatmessagecontentsasync-empty-but-getchatmessagecont | c#, asp.net-core, large-language-model, semantic-kernel, lm-studio | 1,739,443,762 |
se_77880191 | stackoverflow | ARTIFICIAL_INTELLIGENCE | RuntimeError: Expected is_sm80 || is_sm90 to be true, but got false | RuntimeError: Expected is_sm80 || is_sm90 to be true, but got false
I want to run a local FineTuning of LLama. I followed the colab notebook from the pytorch blog post "Finetune LLMs on your own consumer hardware using tools from PyTorch and Hugging Face ecosystem".
I got everything up and running but in the training ... | https://stackoverflow.com/questions/77880191/runtimeerror-expected-is-sm80-is-sm90-to-be-true-but-got-false | pytorch, cuda, nvidia, huggingface-transformers, large-language-model | 1,706,187,878 |
se_77758436 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Autogen response in a variable | Autogen response in a variable
import autogen
from nicegui import ui, context
from uuid import uuid4
# AutoGen Configuration
config_list = [
{
'model': 'gpt-4',
'api_key': ''
}
]
llm_config = {
'seed': 42,
'config_list': config_list,
'temperature': 0.2
}
# Initialize AutoGen Agen... | https://stackoverflow.com/questions/77758436/autogen-response-in-a-variable | python, artificial-intelligence, large-language-model, ms-autogen | 1,704,372,932 |
se_78356777 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What does "I" in the section "_IQ" and "_M" mean in this name "Meta-Llama-3-8B-Instruct-IQ3_M.gguf"? | What does "I" in the section "_IQ" and "_M" mean in this name "Meta-Llama-3-8B-Instruct-IQ3_M.gguf"?
Appreciate if someone could let me know what does "I" in the section "_IQ" and "_M" mean in this name "Meta-Llama-3-8B-Instruct-IQ3_M.gguf"???
I searched and found what does the ... | https://stackoverflow.com/questions/78356777/what-does-i-in-the-section-iq-and-m-mean-in-this-name-meta-llama-3-8b-i | artificial-intelligence, large-language-model, llama, ollama, lm-studio | 1,713,578,504 |
se_79436671 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error: Invalid input type <class 'langchain_core.prompts.chat.ChatPromptTemplate'>. Must be a PromptValue, str, or list of BaseMessages | Error: Invalid input type <class 'langchain_core.prompts.chat.ChatPromptTemplate'>. Must be a PromptValue, str, or list of BaseMessages
I'm trying to make small project, which can save text from flutter app to mongo db and get text with fastAPI, make good answer with langchain openai llm.
what I finally ... | https://stackoverflow.com/questions/79436671/error-invalid-input-type-class-langchain-core-prompts-chat-chatprompttemplate | fastapi, openai-api, langchain, large-language-model | 1,739,459,050 |
se_79436279 | stackoverflow | ARTIFICIAL_INTELLIGENCE | KeyError when constructing a prompt with JSON text in LangChain | KeyError when constructing a prompt with JSON text in LangChain
I'm trying to create a few-shot prompt for a bot that summarizes the contents of a JSON file. No matter what input I give the FewShotPromptTemplate, it fails with a KeyError: '\n "name"'. Just doing example_prompt.invoke(examples[0]).to_string() works ... | https://stackoverflow.com/questions/79436279/keyerror-when-constructing-a-prompt-with-json-text-in-langchain | python, langchain, large-language-model | 1,739,452,189 |
se_79433111 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is there a generic way to escape special characters in prompts when using Semantic Kernel? | Is there a generic way to escape special characters in prompts when using Semantic Kernel?
This is my prompt invocation in C#:
var result = await kernel.InvokePromptAsync(prompt, new(executionSettings));
It works like a charm, except if the prompt contains something like this:
{ bla } {{ bla }} { $bla } {{ bl... | https://stackoverflow.com/questions/79433111/is-there-a-generic-way-to-escape-special-characters-in-prompts-when-using-semant | artificial-intelligence, large-language-model, semantic-kernel | 1,739,364,433 |
se_76833143 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I split csv file read in langchain | How can I split csv file read in langchain
this is set up for langchain
from langchain.text_splitter import RecursiveCharacterTextSplitter
text_splitter=RecursiveCharacterTextSplitter(chunk_size=100,
chunk_overlap=20,
length_f... | https://stackoverflow.com/questions/76833143/how-can-i-split-csv-file-read-in-langchain | python, csv, openai-api, langchain, large-language-model | 1,691,126,909 |
se_79424314 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to merge pefted models to the base one in Transformers(Huggingface)? | How to merge pefted models to the base one in Transformers(Huggingface)?
I tried to merge a pefted model to the original one. Cause Hugging face APi only outputs "extra weights" of the fine-tuning as a .safetensors file. I try to merge but failed.
I wonder how to merge them. Or maybe .safetensors file isn't supported... | https://stackoverflow.com/questions/79424314/how-to-merge-pefted-models-to-the-base-one-in-transformershuggingface | huggingface-transformers, prompt, large-language-model, fine-tuning, peft | 1,739,070,330 |
se_77177922 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can we control number of documents to return in RetrievalQA Langchain | Can we control number of documents to return in RetrievalQA Langchain
Can we control the document query parameter in RetrievalQA() like we could do in vectorDBQA() in langchain before? Also, shall I use map_reduce chain type instead for my large documents?
I tried to look into the source code but could not find it. | https://stackoverflow.com/questions/77177922/can-we-control-number-of-documents-to-return-in-retrievalqa-langchain | openai-api, langchain, large-language-model, nlp-question-answering, llama | 1,695,714,079 |
se_77570816 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Alpaca LoRA generate TypeError: LoraConfig.__init__() got an unexpected keyword argument 'enable_lora' | Alpaca LoRA generate TypeError: LoraConfig.__init__() got an unexpected keyword argument 'enable_lora'
I try to use alpaca lora generate.py to get a new model from customize dataset, I have done finetune the lora weight, but when I using generate.py it show up this error msg, the resource I try is from
Fine-tu... | https://stackoverflow.com/questions/77570816/alpaca-lora-generate-typeerror-loraconfig-init-got-an-unexpected-keyword | large-language-model, alpaca | 1,701,257,830 |
se_79026181 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do I run a LLM on multiple GPUs? | How do I run a LLM on multiple GPUs?
I am trying to run Mistral-7b across multiple GPUs, as I have a large number of prompts. I am using a cluster, which provides usage of up to 4 GPUs. However, only one of them is used for inference.
model_name = 'mistralai/Mistral-7B-Instruct-v0.2'
# Load the model and tokenizer
to... | https://stackoverflow.com/questions/79026181/how-do-i-run-a-llm-on-multiple-gpus | pytorch, gpu, large-language-model | 1,727,338,262 |
se_78516807 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Ollama - How to inject context or get model to answer based on context? | Ollama - How to inject context or get model to answer based on context?
I'm trying a simple demo where I give the LLM a document and ask it to answer a few things from the document. So far I've had very little success.
My prompt is various versions of the following:
You are an uncensored and unbiased AI assistant for... | https://stackoverflow.com/questions/78516807/ollama-how-to-inject-context-or-get-model-to-answer-based-on-context | large-language-model, ollama | 1,716,372,880 |
se_79425052 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Generating an n-gram dataset based on an LLM | Generating an n-gram dataset based on an LLM
I want a dataset of common n-grams and their log likelihoods. Normally I would download the Google Books Ngram Exports, but I wonder if I can generate a better dataset using a large language model. For example, this script uses llama_cpp.Llama.create_completion to find like... | https://stackoverflow.com/questions/79425052/generating-an-n-gram-dataset-based-on-an-llm | nlp, large-language-model, n-gram, llama-cpp-python, llamacpp | 1,739,110,870 |
se_78593260 | stackoverflow | ARTIFICIAL_INTELLIGENCE | "You have a version of `bitsandbytes` that is not compatible with 4bit inference and training" | "You have a version of `bitsandbytes` that is not compatible with 4bit inference and training"
I am now trying to finetune a llama3 model.
I am using unsloth,
from unsloth import FastLanguageModel
Then I load Llama3 model.
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "unsloth/llama... | https://stackoverflow.com/questions/78593260/you-have-a-version-of-bitsandbytes-that-is-not-compatible-with-4bit-inference | python, large-language-model, fine-tuning, 8-bit, llama3 | 1,717,780,110 |
se_79422187 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Sending an attachment to Claude in AWS Bedrock | Sending an attachment to Claude in AWS Bedrock
I've tested my prompt out in the AWS Bedrock Chat interface and I'm happy with it, so I'm now trying to convert it into code.
The issue is that I cannot understand how to attach a txt document to my request.
I've clicked on the paperclip icon to add a file to my prompt. ... | https://stackoverflow.com/questions/79422187/sending-an-attachment-to-claude-in-aws-bedrock | typescript, amazon-web-services, large-language-model, amazon-bedrock | 1,738,963,215 |
se_76264205 | stackoverflow | ARTIFICIAL_INTELLIGENCE | In Langchain, why ConversationalRetrievalChain not remembering the chat history and Entering new ConversationalRetrievalChain chain for each chat? | In Langchain, why ConversationalRetrievalChain not remembering the chat history and Entering new ConversationalRetrievalChain chain for each chat?
I am trying to create an customer support system using langchain. I am using text documents as external knowledge provider via TextLoader
In order to remember the chat I us... | https://stackoverflow.com/questions/76264205/in-langchain-why-conversationalretrievalchain-not-remembering-the-chat-history | python, openai-api, langchain, large-language-model | 1,684,247,209 |
se_78311147 | stackoverflow | ARTIFICIAL_INTELLIGENCE | RuntimeError: Failed to import transformers.integrations.bitsandbytes | RuntimeError: Failed to import transformers.integrations.bitsandbytes
I am trying to load an llm model in 4 bits precision. However, I got RuntimeError: Failed to import transformers.integrations.bitsandbytes because of the following error (look up to see its traceback):
[WinError 193] %1 is not a valid Win32 applicat... | https://stackoverflow.com/questions/78311147/runtimeerror-failed-to-import-transformers-integrations-bitsandbytes | deep-learning, nlp, huggingface-transformers, large-language-model | 1,712,846,265 |
se_78860751 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Use OpenAI API for Embedding Generation with ChromaDB Without LangChain? | How to Use OpenAI API for Embedding Generation with ChromaDB Without LangChain?
I have been using OpenAIEmbeddings from LangChain, which is a model that doesn't require text input directly. I use it to store vector embeddings in ChromaDB with the following code:
db = Chroma(persist_directory=CHROMA_PATH, embedding_fun... | https://stackoverflow.com/questions/78860751/how-to-use-openai-api-for-embedding-generation-with-chromadb-without-langchain | openai-api, langchain, large-language-model, chromadb | 1,723,452,644 |
se_78261430 | stackoverflow | ARTIFICIAL_INTELLIGENCE | TypeError python ollama | TypeError python ollama
from langchain_community.llms import ollama
llm=ollama(base_url='http://localhost:11434',model="llama 2")
I'm encountering a TypeError: 'module' object is not callable error while attempting to use the Ollama LLM in VS Code on my Windows machine. The Ollama server is running successfully on l... | https://stackoverflow.com/questions/78261430/typeerror-python-ollama | python, windows, large-language-model, ollama | 1,712,062,248 |
se_79413654 | stackoverflow | ARTIFICIAL_INTELLIGENCE | My LLM (GPT-4, Llama 2) give different responses for the same prompt | My LLM (GPT-4, Llama 2) give different responses for the same prompt
I am using an OpenAI GPT-4 API (also tested with Llama 2) to generate responses for a chatbot. However, I noticed that sometimes the model gives different answers even when the prompt is exactly the same.
Here is a minimal example:
import openai
prom... | https://stackoverflow.com/questions/79413654/my-llm-gpt-4-llama-2-give-different-responses-for-the-same-prompt | openai-api, large-language-model, gpt-4 | 1,738,729,994 |
se_79104958 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can't make SafetySettings of VertexAI Gemini API work | Can't make SafetySettings of VertexAI Gemini API work
I'm working on a RAG application using VertexAI API.
One of my questions has the word "roubar" and it keeps triggering the safety filter, like:
...
Candidate:
{
"index": 0,
"finish_reason": "SAFETY",
"safety_ratings": [
{
"category": "HARM_CATEG... | https://stackoverflow.com/questions/79104958/cant-make-safetysettings-of-vertexai-gemini-api-work | python, large-language-model, google-cloud-vertex-ai, rag | 1,729,341,835 |
se_78601742 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Parallelize Responses to Multiple User Queries in Langchain | How to Parallelize Responses to Multiple User Queries in Langchain
I am currently developing a chatbot using Langchain, and I load the model using LlamaCPP. The responses are generated through a chain process. However, I encounter an issue where the process crashes immediately if a new prompt is input while the model ... | https://stackoverflow.com/questions/78601742/how-to-parallelize-responses-to-multiple-user-queries-in-langchain | parallel-processing, chatbot, langchain, large-language-model | 1,718,015,028 |
se_79379037 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can't access AWS Streamlit URL? | Can't access AWS Streamlit URL?
I'm trying to connect AWS LLM to an S3 bucket to be queried with Kendra. I'm following this tutorial, which has worked in the past. I think the new AWS Unified Sagemaker has a different URL than the previous Sagemakers', and it's causing an issue trying to get my Streamlit app URL t... | https://stackoverflow.com/questions/79379037/cant-access-aws-streamlit-url | amazon-web-services, streamlit, large-language-model | 1,737,575,213 |
se_78851901 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Failed loading model in LM Studio | Failed loading model in LM Studio
Trying to load in LM Studio the "TheBloke โข mistral instruct v0 1 7B q3_k_s gguf" I get the following message.
Failed to load model
Error message
"llama.cpp error: 'vk::Device::createShaderModule: ErrorInitializationFailed'"
How can I fix this?
{
"title": "Failed to load model",
"... | https://stackoverflow.com/questions/78851901/failed-loading-model-in-lm-studio | large-language-model, lm-studio | 1,723,193,566 |
se_79344167 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain: How to combine output from multiple prompt? | Langchain: How to combine output from multiple prompt?
I am trying to get the full output from each prompt combined as result.
Below is my code
import os
from constent import openai_key
from langchain_community.llms import OpenAI
import streamlit as st
from langchain import PromptTemplate
from langchain.chains im... | https://stackoverflow.com/questions/79344167/langchain-how-to-combine-output-from-multiple-prompt | python-3.x, openai-api, langchain, large-language-model | 1,736,460,674 |
se_79400971 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to check total no. of tokens while using Langchain's 'create_pandas_dataframe_agent'? | How to check total no. of tokens while using Langchain's 'create_pandas_dataframe_agent'?
I am using langchain's create_pandas_dataframe_agent agent to analyse a dataframe. The code looks like below:
from langchain_experimental.agents import create_pandas_dataframe_agent
import pandas as pd
from langchain_... | https://stackoverflow.com/questions/79400971/how-to-check-total-no-of-tokens-while-using-langchains-create-pandas-datafram | python, large-language-model, py-langchain, langchain-agents | 1,738,263,795 |
se_79032382 | stackoverflow | ARTIFICIAL_INTELLIGENCE | groq.APIConnectionError: Connection error | groq.APIConnectionError: Connection error
I am using Langchain and Groq for LLM project but I am getting API connection error, although I imported:
import os
load_dotenv()
and then loaded API as:
groq_api_key = os.getenv("GROQ_API_KEY")
os.environ["GROQ_API_KEY"] = groq_api_key
Still, I am getting this error
Trac... | https://stackoverflow.com/questions/79032382/groq-apiconnectionerror-connection-error | python, ssl-certificate, langchain, large-language-model, groq | 1,727,458,198 |
se_79410466 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is gemma_pytorch next token generation code setting the input_token_positions a wrong way? | Is gemma_pytorch next token generation code setting the input_token_positions a wrong way?
In gemma_torch repo (https://github.com/google/gemma_pytorch/tree/3294a89203f6227dc828b136564d3cb23bc6d115). I find that it only takes previous token when generating next token from the second one (https://github.com/google/gemm... | https://stackoverflow.com/questions/79410466/is-gemma-pytorch-next-token-generation-code-setting-the-input-token-positions-a | large-language-model, gemma | 1,738,637,017 |
se_79399279 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do i use agents in langgraph workflow | How do i use agents in langgraph workflow
tools = [check_user_promotion, get_local_data, get_kpi_info, list_all_kpis]
llm_with_tools = model.bind_tools(tools)
def reasoner(state: MessagesState):
message_history = [
msg for msg in state["messages"][:-1]
if isinstance(msg, (HumanMessage, AIMessage... | https://stackoverflow.com/questions/79399279/how-do-i-use-agents-in-langgraph-workflow | python, openai-api, langchain, large-language-model, langgraph | 1,738,227,071 |
se_79402035 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I add citations in the response on Vectara? While testing the Multiple Corpora Query | How can I add citations in the response on Vectara? While testing the Multiple Corpora Query
How can I add citations in the response on Vectara? While testing the Multiple Corpora Query, I updated the citation in the payload. I followed the approach mentioned in the Vectara documentation.
I have tried all the models m... | https://stackoverflow.com/questions/79402035/how-can-i-add-citations-in-the-response-on-vectara-while-testing-the-multiple-c | nlp, large-language-model, rag | 1,738,308,395 |
se_77586219 | stackoverflow | ARTIFICIAL_INTELLIGENCE | WARNING - Can't find a Python library, got libdir=None, ldlibrary=None, multiarch=None, masd=None | WARNING - Can't find a Python library, got libdir=None, ldlibrary=None, multiarch=None, masd=None
Trying to install llama-cpp-python with "pip install llama-cpp-python". It is failing with following error.
pip install llama-cpp-python
Collecting llama-cpp-python
Using cached llama_cpp_python-0.2.20.tar.gz (8.7 M... | https://stackoverflow.com/questions/77586219/warning-cant-find-a-python-library-got-libdir-none-ldlibrary-none-multiarc | python, python-3.x, windows, openai-api, large-language-model | 1,701,443,150 |
se_79404534 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to set up Crawl4AI with managed browser | How to set up Crawl4AI with managed browser
Hello I am trying to setup a crawl4ai script with a managed browser from this guide:
https://docs.crawl4ai.com/advanced/identity-based-crawling/
I am running with WSL2 on Windows11. When I run my script, it can't seem to execute the script with a managed browser. I see the b... | https://stackoverflow.com/questions/79404534/how-to-set-up-crawl4ai-with-managed-browser | python, web-scraping, playwright, large-language-model | 1,738,391,538 |
se_79380579 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to deploy gpt4o-mini on Microsoft Azure and get a "Custom LLM URL" for integration? | How to deploy gpt4o-mini on Microsoft Azure and get a "Custom LLM URL" for integration?
Iโm trying to deploy gpt4o-mini on Microsoft Azure to get a URL I can use as a "Custom LLM URL" in my AI application.
Iโve followed the documentation, created an Azure OpenAI resource, and tested the model in the playgrou... | https://stackoverflow.com/questions/79380579/how-to-deploy-gpt4o-mini-on-microsoft-azure-and-get-a-custom-llm-url-for-integ | azure, openai-api, large-language-model, azure-openai | 1,737,626,588 |
se_78512403 | stackoverflow | ARTIFICIAL_INTELLIGENCE | problem when pulling ollama's llm using the cli | problem when pulling ollama's llm using the cli
I've recently downloaded ollama from their official website then when i tried to pull one of the models using the command ollama pull mistral I've got this error:
` ollama : The term 'ollama' is not recognized as the name
of a cmdlet, function, script file, or opera... | https://stackoverflow.com/questions/78512403/problem-when-pulling-ollamas-llm-using-the-cli | window, langchain, large-language-model, ollama | 1,716,299,979 |
se_79362738 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error calling the LLM using model API, using LlamaIndex | Error calling the LLM using model API, using LlamaIndex
I am trying to build an agent that searches in a database, but when I call the query, o LlamaIndex is calling the OpenAI's API apparently, when it should to call the Groq API.
Code:
model = 'llama-3.3-70b-versatile'
model_hf_emb = 'BAAI/bge-m3'
Settings.llm = Gro... | https://stackoverflow.com/questions/79362738/error-calling-the-llm-using-model-api-using-llamaindex | openai-api, large-language-model, llama, llama-index, groq | 1,737,052,644 |
se_79398626 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why does LLM supervised fine tuning only need small amounts of data? | Why does LLM supervised fine tuning only need small amounts of data?
Iโve taken some courses of LLM and reproduced a small LLM from scratch and trained on Shakespeare data. Now Iโm learning supervised fine tuning but having difficulty understanding why it only needs much smaller size of datasets (compared to pre-train... | https://stackoverflow.com/questions/79398626/why-does-llm-supervised-fine-tuning-only-need-small-amounts-of-data | large-language-model, fine-tuning | 1,738,202,831 |
se_79379000 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Failed to use model_dump to serialize <class 'langchain_community.tools.tavily_search.tool.TavilySearchResults'> | Failed to use model_dump to serialize <class 'langchain_community.tools.tavily_search.tool.TavilySearchResults'>
Failed to use model_dump to serialize <class 'langchain_community.tools.tavily_search.tool.TavilySearchResults'> to JSON: PydanticSerializationError(Unable to serialize unknown type: <class 'p... | https://stackoverflow.com/questions/79379000/failed-to-use-model-dump-to-serialize-class-langchain-community-tools-tavily-s | python, pydantic, langchain, large-language-model, langgraph | 1,737,574,171 |
se_79397234 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LLama Parse output table as html in the markdown not working | LLama Parse output table as html in the markdown not working
Parsing pdfs is very complicated when it comes to tables. There are cells sometimes that span multiple columns and while we as humans have no trouble understanding it, LLMs do not and parsing data properly is very important if we want good results. The docum... | https://stackoverflow.com/questions/79397234/llama-parse-output-table-as-html-in-the-markdown-not-working | html, pdf, markdown, large-language-model, llama-parse | 1,738,163,788 |
se_79397209 | stackoverflow | ARTIFICIAL_INTELLIGENCE | llama_index always say "The provided text does not contain any information regarding...." | llama_index always say "The provided text does not contain any information regarding...."
I am trying to build RAG LLM using llamaindex.
I use Ollama models: (1) gemma for chatmodel and (2) nomic-embed-text for the embedding.
I use the exact the models with langchain and it work properly (giving me the resul... | https://stackoverflow.com/questions/79397209/llama-index-always-say-the-provided-text-does-not-contain-any-information-regar | python, langchain, large-language-model, llama-index, rag | 1,738,163,640 |
se_78481760 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Ollama, how can I use all the GPUs I have? | Ollama, how can I use all the GPUs I have?
I am running Ollma on a 4xA100 GPU server, but it looks like only 1 GPU is used for the LLaMa3:7b model.
How can I use all 4 GPUs simultaneously?
I am not using a docker, just use ollama serve and ollama run.
Or is there a way to run 4 server processes simultaneously (each on... | https://stackoverflow.com/questions/78481760/ollama-how-can-i-use-all-the-gpus-i-have | parallel-processing, gpu, large-language-model, ollama | 1,715,750,897 |
se_79391242 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to customise the LlamaIndex starter tuto to use the latest Llama model hosted on "akash.network" | How to customise the LlamaIndex starter tuto to use the latest Llama model hosted on "akash.network"
The akash chat API is supposed to be compatible with openai : https://chatapi.akash.network/documentation, it's compatible with the basic OpenAI SDK :
import openai
import textwrap
client = openai.OpenAI(
... | https://stackoverflow.com/questions/79391242/how-to-customise-the-llamaindex-starter-tuto-to-use-the-latest-llama-model-hoste | python, large-language-model, llama-index | 1,737,990,105 |
se_79102713 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Does Litellm package really support celery call with --pool=gevent | Does Litellm package really support celery call with --pool=gevent
I want to perform parallel call to llm model using litellm==1.49.7 package using celery with --pool=gevent
but I got following error how do I solve
response = loop.create_task(completion(
model=SELECTED_AI_MODEL,
... | https://stackoverflow.com/questions/79102713/does-litellm-package-really-support-celery-call-with-pool-gevent | python, python-asyncio, openai-api, large-language-model | 1,729,265,286 |
se_79390234 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Cuda out of memory while training | Cuda out of memory while training
I'm trying to finetune a base model with my own data using prompts, however I keep getting this error:
OutOfMemoryError: CUDA out of memory. Tried to allocate 224.00 MiB. GPU 0 has a total capacity of 79.25 GiB of which 177.50 MiB is free. Process 230359 has 79.07 GiB memory in use. ... | https://stackoverflow.com/questions/79390234/cuda-out-of-memory-while-training | nlp, tokenize, large-language-model, fine-tuning | 1,737,969,820 |
se_79389248 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Loss stays constant at ~1.0 during training DPO | Loss stays constant at ~1.0 during training DPO
I am training model with Lora adapter using a APO loss function for preference optimization with trl
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-1.5B-Instruct", device_map='auto', load_in_4bit=True)
lora_config = LoraConfig(
r=64,
lora_alpha=16,
... | https://stackoverflow.com/questions/79389248/loss-stays-constant-at-1-0-during-training-dpo | large-language-model, fine-tuning | 1,737,923,213 |
se_79390210 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Does Ollama guarantee cross-platform determinism with identical quantization, seed, temperature, and version but differing hardware? | Does Ollama guarantee cross-platform determinism with identical quantization, seed, temperature, and version but differing hardware?
Iโm working on a project that requires fully deterministic outputs across different machines using Ollama. Iโve ensured the following parameters are identical:
Model quantization (e.g., ... | https://stackoverflow.com/questions/79390210/does-ollama-guarantee-cross-platform-determinism-with-identical-quantization-se | nvidia, large-language-model, deterministic, ollama, llama-cpp-python | 1,737,969,190 |
se_79380706 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ValueError: text input must be of type `str` (single example), `List[str]` (batch or single pretokenized example) | ValueError: text input must be of type `str` (single example), `List[str]` (batch or single pretokenized example)
I am trying to fine tune vision llm model like Qwen/Qwen2-VL-7B-Instruct. I have the following dataset in .jsonl file
{"messages": [{"role": "system", "content": [{"type": "text", "text": "You are an exper... | https://stackoverflow.com/questions/79380706/valueerror-text-input-must-be-of-type-str-single-example-liststr-batc | python, large-language-model | 1,737,629,028 |
se_79284426 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to manage memory consumption in deep learning models? | How to manage memory consumption in deep learning models?
When I run this code, the runtime session automatically closes. There is no space in RAM left. Hence the session closes automatically. I am using pytorch in Google Colab notebook. I tried switching from CPU to GPU but still the session closes automatically.
!pi... | https://stackoverflow.com/questions/79284426/how-to-manage-memory-consumption-in-deep-learning-models | deep-learning, pytorch, data-science, large-language-model, transfer-learning | 1,734,346,810 |
se_78561628 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Resume finetuning of LLM with LoRA | Resume finetuning of LLM with LoRA
I have fine-tuned a Phi-3 for 1 epoch using LoRA as follows:
self.model=AutoModelForCausalLM.from_pretrained(self.model_args.model_name_or_path,**kwarg)
self.model = get_peft_model(self.model, self.lora_config)
Now I want to resume from existing LoRA weights by loading the weights a... | https://stackoverflow.com/questions/78561628/resume-finetuning-of-llm-with-lora | pytorch, huggingface-transformers, large-language-model | 1,717,180,000 |
se_79102249 | stackoverflow | ARTIFICIAL_INTELLIGENCE | langchain with_structured_output Parsing a dictionary of lists of custom classes | langchain with_structured_output Parsing a dictionary of lists of custom classes
I am trying to use Langchain to Extract Structured Output from Unstructured Texts with LLM Tool-Calling.
I have a code that works:
import os
from pydantic import BaseModel, Field
from langchain_openai import ChatOpenAI
model = Ch... | https://stackoverflow.com/questions/79102249/langchain-with-structured-output-parsing-a-dictionary-of-lists-of-custom-classes | python, dictionary, large-language-model, py-langchain | 1,729,257,398 |
se_79368955 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Llama 3: Getting a CUDA unknown error while fine tuning Llama 3 on wikitext | Llama 3: Getting a CUDA unknown error while fine tuning Llama 3 on wikitext
I am a beginner in Large Language Models and the Hugging Face API. I was trying to fine tune the Llama 3.1 8b model on the wikitext dataset as practice.
When I try to run the following script, I get an unknown CUDA error.
CUDA error: unknown e... | https://stackoverflow.com/questions/79368955/llama-3-getting-a-cuda-unknown-error-while-fine-tuning-llama-3-on-wikitext | python, pytorch, large-language-model, llama, fine-tuning | 1,737,290,437 |
se_79354534 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to load a finetuned vision llm model? Moondream model case | How to load a finetuned vision llm model? Moondream model case
I've finetuned the moondream model for my own image inference case. I used the finetune script provided on the official repository.
It all went well after learning how to use the script for my dataset.
The script generated the following files when i've "sa... | https://stackoverflow.com/questions/79354534/how-to-load-a-finetuned-vision-llm-model-moondream-model-case | python, artificial-intelligence, huggingface-transformers, large-language-model | 1,736,847,414 |
se_79361959 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use SQLDatabaseSequentialChain on Langchain for Large Structured Database? | How to use SQLDatabaseSequentialChain on Langchain for Large Structured Database?
I'm having an issue with LangChain's SQLDatabaseSequentialChain where it generates SQL queries wrapped in markdown code blocks, causing execution errors with SQLAlchemy.
Error Message
File "/home/dkrnd/projects/llm_learn/.venv/lib/python... | https://stackoverflow.com/questions/79361959/how-to-use-sqldatabasesequentialchain-on-langchain-for-large-structured-database | python, langchain, large-language-model, rag | 1,737,037,531 |
se_77217193 | stackoverflow | ARTIFICIAL_INTELLIGENCE | langchain: how to use a custom embedding model locally? | langchain: how to use a custom embedding model locally?
I am trying to use a custom embedding model in Langchain with chromaDB. I can't seem to find a way to use the base embedding class without having to use some other provider (like OpenAIEmbeddings or HuggingFaceEmbeddings). Am I missing something?
On the Langchain... | https://stackoverflow.com/questions/77217193/langchain-how-to-use-a-custom-embedding-model-locally | langchain, large-language-model, py-langchain, chromadb | 1,696,265,494 |
se_77061898 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Incomplete Output with LLM with max_new_tokens | Incomplete Output with LLM with max_new_tokens
I am experimenting with Huggingface LLM models.
And one issue I noticed is that output of the model ends abruptly and I ideally want it to complete the paragraph/sentences/code which it was it between of. (or altogether try to complete the answer within some fixed num of ... | https://stackoverflow.com/questions/77061898/incomplete-output-with-llm-with-max-new-tokens | machine-learning, huggingface-transformers, transformer-model, huggingface, large-language-model | 1,694,109,720 |
se_79347454 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Browser-use OSError: cannot open resource | Browser-use OSError: cannot open resource
I am working with browser-use python library and I encountered a font error when running the code. The code works fine with most websites but for some reason, it doesn't work with others.
Details:
I am using the browser_use and langchain_openai libraries to extract and process... | https://stackoverflow.com/questions/79347454/browser-use-oserror-cannot-open-resource | python, large-language-model, browser-automation | 1,736,564,084 |
se_79348718 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Cannot download Llama 3.2 3B model using Unsloth and Hugging Face | Cannot download Llama 3.2 3B model using Unsloth and Hugging Face
I want to locally fine-tune using my own dataset and then save the Llama 3.2-3B model locally too. I have an Anaconda setup and I'm on the base environment, where I can see clearly that unsloth and hugging face are both installed.
However everytime I si... | https://stackoverflow.com/questions/79348718/cannot-download-llama-3-2-3b-model-using-unsloth-and-hugging-face | artificial-intelligence, large-language-model, huggingface, llama, huggingface-hub | 1,736,622,960 |
se_79222803 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LLM output repeating itself [typo] | LLM output repeating itself [typo]
I am currently following this tutorial on making a basic LLM that spews Shakespeare like text(The full code for the transformer is at the the end). I am at the end but when I train it and get an output the output just keeps repeating itself with the same stuff. Here is my code
import... | https://stackoverflow.com/questions/79222803/llm-output-repeating-itself-typo | python, pytorch, large-language-model | 1,732,533,453 |
se_76471292 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to finetune an LLM model on your own codebase? | How to finetune an LLM model on your own codebase?
I have 10 code repositories in Javascript (VueJS) (Each repository corresponds to 1 Theme)
I want to train an LLM model on these 10 code repositories to generate new themes using prompts.
The LLM model takes the context of 10 code repositories as a reference (since th... | https://stackoverflow.com/questions/76471292/how-to-finetune-an-llm-model-on-your-own-codebase | code-generation, huggingface, large-language-model | 1,686,729,291 |
se_79347444 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can one get the LLM model name and version using Google AI Edge SDK? | How can one get the LLM model name and version using Google AI Edge SDK?
I use Google AI Edge SDK to call an on-device LLM (example app). How can I get the LLM model name and version that my code uses?
https://developer.android.com/ai/gemini-nano says it uses Gemini Nano:
but there are at least 2 versions of Gemini N... | https://stackoverflow.com/questions/79347444/how-can-one-get-the-llm-model-name-and-version-using-google-ai-edge-sdk | android, nlp, large-language-model | 1,736,563,378 |
se_77259412 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AttributeError: 'LlamaForCausalLM' object has no attribute 'load_adapter' | AttributeError: 'LlamaForCausalLM' object has no attribute 'load_adapter'
I trained a model based on meta-llama/Llama-2-7b-chat-hf with peft, a quantized model and lora.
Then I saved my model via
model.push_to_hub("my-awesome-model")
now I can't load the model anymore and it shows the following error:... | https://stackoverflow.com/questions/77259412/attributeerror-llamaforcausallm-object-has-no-attribute-load-adapter | huggingface-transformers, large-language-model, llama, peft | 1,696,859,612 |
se_79338718 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Do I have to write custom AutoModel transformers class in case "TypeError: NVEmbedModel.forward() got an unexpected keyword argument 'inputs_embeds'" | Do I have to write custom AutoModel transformers class in case "TypeError: NVEmbedModel.forward() got an unexpected keyword argument 'inputs_embeds'"
I am trying to finetune the nvidia/NV-Embed-v2 model from hugging face using lora from peft library. I am facing the "TypeError: NVEmbedModel.forward()... | https://stackoverflow.com/questions/79338718/do-i-have-to-write-custom-automodel-transformers-class-in-case-typeerror-nvemb | deep-learning, huggingface-transformers, large-language-model, peft | 1,736,331,133 |
se_78907608 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to pass multiple inputs during invoke to a MessageGraph? | How to pass multiple inputs during invoke to a MessageGraph?
We have a MessageGraph for an LLMCompiler implementation and as expected we pass a users's question when running invoke as a list of HumanMessage objects (which are mapped to a default "messages" key and passed to prompt templates), this works fine for simpl... | https://stackoverflow.com/questions/78907608/how-to-pass-multiple-inputs-during-invoke-to-a-messagegraph | machine-learning, artificial-intelligence, langchain, large-language-model, langgraph | 1,724,448,627 |
se_79162350 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is there any flag to stop langgraph for further executing? | Is there any flag to stop langgraph for further executing?
I want to create a interviewing bot that may ask 5 questions. The questions are specified in the system prompt. I just want the langgraph to stop execution when 5 certain questions are asked.
I tried quick start of the langgraph official docs. I read the docum... | https://stackoverflow.com/questions/79162350/is-there-any-flag-to-stop-langgraph-for-further-executing | python, nlp, chatbot, large-language-model, langgraph | 1,730,891,670 |
se_78141292 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to keep conversation context of multiple users separate for LLM chatbot coded in Python-Flask | How to keep conversation context of multiple users separate for LLM chatbot coded in Python-Flask
Apologies in advance as this is probably an easy thing to fix. I'm still new to programming and learning as I go.
I'm working on a chatbot using Python Flask, OpenAI's LLM, and the LLAMA Index library. Itโs currently bein... | https://stackoverflow.com/questions/78141292/how-to-keep-conversation-context-of-multiple-users-separate-for-llm-chatbot-code | python, flask, openai-api, large-language-model, llama-index | 1,710,166,558 |
se_79328514 | stackoverflow | ARTIFICIAL_INTELLIGENCE | how to get custom column in the model's forward() function when training with Huggingface Trainer? | how to get custom column in the model's forward() function when training with Huggingface Trainer?
I am using Huggingface Trainer to train a cumstom model subclassing a Llama llm. After tokenized by the tokenizer, my dataset has these fields 'input_ids', 'labels' and so on, and I additionally add 2 custom colunms ... | https://stackoverflow.com/questions/79328514/how-to-get-custom-column-in-the-models-forward-function-when-training-with-hu | pytorch, nlp, large-language-model, huggingface-trainer | 1,735,981,064 |
se_79006700 | stackoverflow | ARTIFICIAL_INTELLIGENCE | litellm.BadRequestError: GetLLMProvider Exception 'Ollama' object has no attribute 'split' | litellm.BadRequestError: GetLLMProvider Exception 'Ollama' object has no attribute 'split'
raise litellm.exceptions.BadRequestError(litellm.exceptions.BadRequestError: litellm.BadRequestError: GetLLMProvider Exception - 'Ollama' object has no attribute 'split'
I am creating an AI agent based system and... | https://stackoverflow.com/questions/79006700/litellm-badrequesterror-getllmprovider-exception-ollama-object-has-no-attribu | langchain, large-language-model, agent, ollama, crewai | 1,726,834,560 |
se_78653905 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Optimize Prompt Engineering for Financial Advice from the FinguAI Language Model? | How to Optimize Prompt Engineering for Financial Advice from the FinguAI Language Model?
I'm working on a personal finance application that uses the FinguAI language model to generate personalized insights and financial advice based on user-provided expense data. However, I'm facing challenges in getting the model to ... | https://stackoverflow.com/questions/78653905/how-to-optimize-prompt-engineering-for-financial-advice-from-the-finguai-languag | huggingface-transformers, large-language-model | 1,718,993,744 |
se_79323765 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Create native picture embeddings and then make a similarity search with text | Create native picture embeddings and then make a similarity search with text
Is it generally possible to create image embeddings directly (without additional text) and store them in a database? The aim is to make the content of the images findable later via a text input in the front end using a similarity search. Is t... | https://stackoverflow.com/questions/79323765/create-native-picture-embeddings-and-then-make-a-similarity-search-with-text | python, openai-api, large-language-model, word-embedding | 1,735,822,232 |
se_79323814 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Handling Pagination in LLM-based Scraping | Handling Pagination in LLM-based Scraping
I am writing a web-scraper that has to visit a number of different websites and scrape useful information using LLM. However, some of my target websites have pagination, and in particular, some of them don't have a different URL from one page to another. That is, perhaps the n... | https://stackoverflow.com/questions/79323814/handling-pagination-in-llm-based-scraping | python, web-scraping, pagination, langchain, large-language-model | 1,735,823,391 |
se_79295908 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Azure ML Vector Index creation in Prompt Flow UI | Azure ML Vector Index creation in Prompt Flow UI
Iยดm trying to create an Azure Search vector index as well in the Azure ML UI (Prompt flow) portal but having an error in the component "LLM - Crack and Chunk Data": My Flow Error Image
The error says:
User program failed with BaseRagServiceError: Rag system error
Part o... | https://stackoverflow.com/questions/79295908/azure-ml-vector-index-creation-in-prompt-flow-ui | azure, indexing, azure-machine-learning-service, large-language-model, azure-promptflow | 1,734,653,602 |
se_79319737 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LLM Function calling in Spring AI results in error : exc.InvalidFormatException: Cannot deserialize value of type | LLM Function calling in Spring AI results in error : exc.InvalidFormatException: Cannot deserialize value of type
I tried to implement function calling with Spring-AI but I see that method parameters are not passed correctly.
For example I have this function 'routeChatFunction' that takes AgentChatRequest as input cla... | https://stackoverflow.com/questions/79319737/llm-function-calling-in-spring-ai-results-in-error-exc-invalidformatexception | java, spring, artificial-intelligence, large-language-model, spring-ai | 1,735,641,186 |
se_78549448 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain with Redis responding only to the previous question | Langchain with Redis responding only to the previous question
I am using Langchain with Redis as the persistence layer. It works, but kind ofโI have a strange behavior which is as follows:
I send a message, and it always responds to the previous prompt's message.
I don't know what's wrong; I followed the official docu... | https://stackoverflow.com/questions/78549448/langchain-with-redis-responding-only-to-the-previous-question | python, langchain, large-language-model | 1,716,984,596 |
se_79321187 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to specify the response format in langchain-go when using structured JSON mode? | How to specify the response format in langchain-go when using structured JSON mode?
when usign the openai go api library (openai-go), i can specify to use the structured JSON response mode in the ChatCompletionParams, where the ResponseFormat field takes the JSONSchema as a parameter like so:
params := openai.ChatComp... | https://stackoverflow.com/questions/79321187/how-to-specify-the-response-format-in-langchain-go-when-using-structured-json-mo | json, go, openai-api, langchain, large-language-model | 1,735,708,510 |
se_78236403 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Issue with Passing Retrieved Documents to Large Language Model in RetrievalQA Chain | Issue with Passing Retrieved Documents to Large Language Model in RetrievalQA Chain
I'm currently enrolled in a course on Coursera where I'm learning to implement a retrieval-based question-answering (RetrievalQA) system in Python. The course provides code that utilizes the RetrievalQA.from_chain_type() method to crea... | https://stackoverflow.com/questions/78236403/issue-with-passing-retrieved-documents-to-large-language-model-in-retrievalqa-ch | python, langchain, information-retrieval, large-language-model, nlp-question-answering | 1,711,609,811 |
se_76659831 | stackoverflow | ARTIFICIAL_INTELLIGENCE | hugging face pipeline error from langchain PydanticUserError: | hugging face pipeline error from langchain PydanticUserError:
I'm having following error while trying to load the hugging face pipeline from langchain
PydanticUserError: If you use @root_validator with pre=False (the
default) you MUST specify skip_on_failure=True. Note that
@root_validator is deprecated and should be... | https://stackoverflow.com/questions/76659831/hugging-face-pipeline-error-from-langchain-pydanticusererror | database, artificial-intelligence, langchain, large-language-model | 1,689,062,523 |
se_78997046 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Running codellama in terminal using python without downloading the model | Running codellama in terminal using python without downloading the model
Is there any way to access the Codellama model without downloading the model itself? Like a simple Python program asking the user for the prompt and outputting the answer from the LLM using an API or something? | https://stackoverflow.com/questions/78997046/running-codellama-in-terminal-using-python-without-downloading-the-model | large-language-model | 1,726,645,154 |
se_79309907 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Finetuning with 8.1B Llama with LORA but responses are just repetitions of the inputs on inference | Finetuning with 8.1B Llama with LORA but responses are just repetitions of the inputs on inference
I'm finetuning a Llama 8.1B using LoRA with about a 1,000 samples for 3 epochs but after training (which takes about 3 hours) the model on inference just keeps repeating the input.
I'm using the
`{
"instruction": "Do... | https://stackoverflow.com/questions/79309907/finetuning-with-8-1b-llama-with-lora-but-responses-are-just-repetitions-of-the-i | pytorch, large-language-model, llama, fine-tuning | 1,735,229,770 |
se_78534769 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Include Chat History When Using Google Gemini's API | How to Include Chat History When Using Google Gemini's API
I'm trying to feed chat history to the Google Gemini API using a cURL request. I want to provide both the user's previous input and the model's previous response in the request. Here's the cURL command I'm using:
curl --location 'https://generativelanguage... | https://stackoverflow.com/questions/78534769/how-to-include-chat-history-when-using-google-geminis-api | curl, large-language-model, google-gemini | 1,716,714,321 |
se_78589268 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Fine Tune Huggingface model via Trainer API without labels? | Fine Tune Huggingface model via Trainer API without labels?
I am following Huggingfaces Tutorial on fine-tuning a model. Unfortunately, they only show the procedure for fine-tuning BERT to a classifier by providing labeled data.
My case is a bit different: I want to fine-tune gpt-2 to generate text in a specific writi... | https://stackoverflow.com/questions/78589268/fine-tune-huggingface-model-via-trainer-api-without-labels | huggingface-transformers, large-language-model, huggingface, fine-tuning, huggingface-trainer | 1,717,712,387 |
se_77932443 | stackoverflow | ARTIFICIAL_INTELLIGENCE | mistralai - AttributeError: 'ChatMessage' object has no attribute 'model_dump' | mistralai - AttributeError: 'ChatMessage' object has no attribute 'model_dump'
I am trying to run a Mistral AI's python client code example shown below.
from mistralai.client import MistralClient
from mistralai.models.chat_completion import ChatMessage
model = "mistral-tiny"
client = MistralClient(ap... | https://stackoverflow.com/questions/77932443/mistralai-attributeerror-chatmessage-object-has-no-attribute-model-dump | python, python-3.x, artificial-intelligence, large-language-model | 1,706,970,181 |
se_78925963 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unexpected value passed to LangChain Tool argument | Unexpected value passed to LangChain Tool argument
I'm trying to create a simple example tool that creates new user accounts in a hypothetical application when instructed to do so via a user prompt. The llm being used is llama3.1:8b via Ollama.
So far what I've written works, but it's very unreliable.
The reason why i... | https://stackoverflow.com/questions/78925963/unexpected-value-passed-to-langchain-tool-argument | python, langchain, large-language-model | 1,724,900,277 |
se_79298071 | stackoverflow | ARTIFICIAL_INTELLIGENCE | 400 Unsupported data type | Azure open ai assistant issue? | 400 Unsupported data type | Azure open ai assistant issue?
I'm having an issue with azure open ai where all the api details are correct and when i do chat completion it works but the ai assistant don't want to work even tho i'm followin the azure open ai docs, here it is my code:
const
dotenv = require("dotenv");
dot... | https://stackoverflow.com/questions/79298071/400-unsupported-data-type-azure-open-ai-assistant-issue | azure, openai-api, large-language-model, azure-openai | 1,734,717,988 |
se_79301108 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Google's Gemini on local audio files | Google's Gemini on local audio files
Google has a page describing how to use one of their Gemini-1.5 models to transcribe audio. They include a sample script (see below). The script grabs the audio file from Google Storage via the Part.from_uri() command.
I would, instead, like to use a local file. Setting the URI... | https://stackoverflow.com/questions/79301108/googles-gemini-on-local-audio-files | python, audio, large-language-model, google-gemini | 1,734,875,333 |
se_79140160 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain with_structured_output() does not work with HuggingFace | Langchain with_structured_output() does not work with HuggingFace
When I create the LLM instance by calling the with_structured_output() I get an error of
HfHubHTTPError: 422 Client Error: Unprocessable Entity for url: https://api-inference.huggingface.co/models/meta-llama/Llama-3.1-70B-Instruct/v1/chat/completions
F... | https://stackoverflow.com/questions/79140160/langchain-with-structured-output-does-not-work-with-huggingface | python, langchain, large-language-model, huggingface | 1,730,275,326 |
se_76955400 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Save a LLM model after adding RAG pipeline and embedded model and deploy as hugging face inference? | Save a LLM model after adding RAG pipeline and embedded model and deploy as hugging face inference?
I have created a RAG (Retrieval-augmented generation) pipeline and using it with a 4-bit quantized openllama 13b loaded directly from hugging face and without fine-tuning the model.
At first I need to save the model in... | https://stackoverflow.com/questions/76955400/save-a-llm-model-after-adding-rag-pipeline-and-embedded-model-and-deploy-as-hugg | huggingface, large-language-model, llama | 1,692,723,334 |
se_79298879 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ModuleNotFoundError: No module named 'huggingface_hub.inference._types' | ModuleNotFoundError: No module named 'huggingface_hub.inference._types'
I am running a RAG pipeline, with LlamaIndex and quantized LLama3-8B-Instruct. I just installed these libraries:
!pip install --upgrade huggingface_hub
!pip install --upgrade peft
!pip install llama-index bitsandbytes accelerate llama-ind... | https://stackoverflow.com/questions/79298879/modulenotfounderror-no-module-named-huggingface-hub-inference-types | python, large-language-model, huggingface, llama-index, retrieval-augmented-generation | 1,734,755,663 |
se_78922311 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to avoid illogical responses from Gemini? | How to avoid illogical responses from Gemini?
We are trying to automate customer support queries using Gen AI (Gemini)
For around 2-3% of the cases, the model gives responses that are not usable (refer to the example below). Prompts are good enough as they solve for 98% of the cases accurately.
"""
I understand you ne... | https://stackoverflow.com/questions/78922311/how-to-avoid-illogical-responses-from-gemini | large-language-model, google-gemini | 1,724,834,454 |
se_78495286 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can i Get a JSON structure response from the google gemini-pro-vision | How can i Get a JSON structure response from the google gemini-pro-vision
google gemini_response is string I need in the JSON Structure like this
{
"Title": "chair",
"Description": "A wooden chair with wheels",
"Category": "Furniture",
"Subcategory": "office stuff",
"EstimatedPrice": "$10 - 20 "
}
I try the json_laod(... | https://stackoverflow.com/questions/78495286/how-can-i-get-a-json-structure-response-from-the-google-gemini-pro-vision | json, large-language-model, google-gemini | 1,715,944,635 |
se_79188754 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Vertex AI Function Calling (using response) | Vertex AI Function Calling (using response)
I need to implement a chatbot that uses helpful functions for calling to interact with the database. This is a sandbox task from the laboratory
I have a problem sending the model a ready API response to be formatted to the user.
Once the necessary functions for database cal... | https://stackoverflow.com/questions/79188754/vertex-ai-function-calling-using-response | python, large-language-model, google-cloud-vertex-ai, function-call, google-gemini | 1,731,587,576 |
se_79293475 | stackoverflow | ARTIFICIAL_INTELLIGENCE | the ouput result is <UNK> models--llava-hf--llava-v1.6-mistral-7b-hf | the ouput result is <UNK> models--llava-hf--llava-v1.6-mistral-7b-hf
I have models--llava-hf--llava-v1.6-mistral-7b-hf to extract info and text from image, but all the output result get the information shown in the image?" [/INST]<unk><unk><unk> <unk>
import torch
from PIL im... | https://stackoverflow.com/questions/79293475/the-ouput-result-is-unk-models-llava-hf-llava-v1-6-mistral-7b-hf | python, huggingface-transformers, large-language-model | 1,734,594,941 |
se_79295026 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain RunnableEach invoke error: response is not valid JSON | Langchain RunnableEach invoke error: response is not valid JSON
I am trying to use RunnableEach to make parallel requests to OpenAI. The responses are supposed to be "yes/no" plus a motivation. I want the response to be in JSON format, my code is like the following:
from langchain_core.prompts import ChatPromptTemplat... | https://stackoverflow.com/questions/79295026/langchain-runnableeach-invoke-error-response-is-not-valid-json | langchain, large-language-model, gpt-4o-mini | 1,734,626,710 |
se_79276301 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is it possible to prompt Gemini a video and get back relevant screenshots from the video | Is it possible to prompt Gemini a video and get back relevant screenshots from the video
I am working on a project and I want to send Gemini 1.5 Pro / Flush an .mp4 video file , and get in return scenes (screenshots) from the video. Wondering if it is possible to get the scenes(images) or not.
If not, Maybe I can get ... | https://stackoverflow.com/questions/79276301/is-it-possible-to-prompt-gemini-a-video-and-get-back-relevant-screenshots-from-t | python, large-language-model, google-gemini | 1,734,030,140 |
se_79290183 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ValueError: {"detail":"Not Found"} while connecting to chromaDB | ValueError: {"detail":"Not Found"} while connecting to chromaDB
I am encountering an issue when using chromadb version 0.5.20, where it raises a ValueError: {"detail":"Not Found"} error. However, this issue does not occur with chromadb version 0.5.3, which works perfectly.
This is the function I ha... | https://stackoverflow.com/questions/79290183/valueerror-detailnot-found-while-connecting-to-chromadb | fastapi, langchain, large-language-model, vector-database, chromadb | 1,734,503,746 |
se_78424761 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Crew ai, Local LLM connection issue | Crew ai, Local LLM connection issue
I am trying to connect ollama Llama2 with crew ai, and i am getting "openai.NotFoundError: 404 page not found"
in .env i have below values
OPENAI_API_BASE=http://localhost:11434/v1 OPENAI_MODEL_NAME=llama2 OPENAI_API_KEY=NA
in main file, i have below line to connect
from langchain_... | https://stackoverflow.com/questions/78424761/crew-ai-local-llm-connection-issue | python, artificial-intelligence, langchain, large-language-model, ollama | 1,714,740,138 |
se_79283846 | stackoverflow | ARTIFICIAL_INTELLIGENCE | --user-dir in Fairseq in failing | --user-dir in Fairseq in failing
Iโm trying to fine-tune the IndicTrans2 model using fairseq-train, but I keep encountering the following error:
fairseq-train: error: argument --user-dir: invalid Optional value: 'C:/Users/sasid/Downloads/en-indic-exp/model_configs'
Iโve provided the --user-dir argument as the path to ... | https://stackoverflow.com/questions/79283846/user-dir-in-fairseq-in-failing | python, nlp, huggingface-transformers, large-language-model, fairseq | 1,734,332,595 |
se_78038771 | stackoverflow | ARTIFICIAL_INTELLIGENCE | I have problem using n_gpu_layers in llama_cpp Llama function | I have problem using n_gpu_layers in llama_cpp Llama function
I am attempting to load the Zephyr model into llama_cpp Llama, and while everything functions correctly, the performance is slow. The GPU appears to be underutilized, especially when compared to its performance in LM Studio, where the same number of GPU lay... | https://stackoverflow.com/questions/78038771/i-have-problem-using-n-gpu-layers-in-llama-cpp-llama-function | large-language-model, llama-cpp-python, llamacpp | 1,708,582,899 |
se_78909701 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use `llama-cpp-python` to output list of candidate tokens and their probabilities? | How to use `llama-cpp-python` to output list of candidate tokens and their probabilities?
I want to manually choose my tokens by myself, instead of letting llama-cpp-python automatically choose one for me.
This requires me to see a list of candidate next tokens, along their probabilities, so that I pick the right one ... | https://stackoverflow.com/questions/78909701/how-to-use-llama-cpp-python-to-output-list-of-candidate-tokens-and-their-proba | large-language-model, llama-cpp-python, llamacpp | 1,724,523,300 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.