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_79283119
stackoverflow
ARTIFICIAL_INTELLIGENCE
Layer-wise Student-Teacher Optimization for Lllama 3.2 1B
Layer-wise Student-Teacher Optimization for Lllama 3.2 1B I'm trying to recreate an experiment from a paper I have read about a teacher-student layer-wise distillation. I'm using the L2 norm to optimize every transformer layer independently. However, it does not converge to a working model. Any ideas on why? import to...
https://stackoverflow.com/questions/79283119/layer-wise-student-teacher-optimization-for-lllama-3-2-1b
machine-learning, pytorch, large-language-model, llama
1,734,294,092
se_79257046
stackoverflow
ARTIFICIAL_INTELLIGENCE
Cannot install llama-index-embeddings-huggingface==0.1.3 because these package versions have conflicting dependencies
Cannot install llama-index-embeddings-huggingface==0.1.3 because these package versions have conflicting dependencies I am unable to install the huggingfaceEmbedding \ Getting the followng error: ERROR: Cannot install llama-index-embeddings-huggingface==0.1.3, llama-index-embeddings-huggingface==0.1.4 and llama-index-...
https://stackoverflow.com/questions/79257046/cannot-install-llama-index-embeddings-huggingface-0-1-3-because-these-package-v
python, huggingface-transformers, large-language-model, huggingface, llama
1,733,466,801
se_79196883
stackoverflow
ARTIFICIAL_INTELLIGENCE
LangChain Chroma, Retrieve not working with Trulens instrument
LangChain Chroma, Retrieve not working with Trulens instrument I have been trying to test my RAG application using TruLens. Whenever I try to use instrument by "from trulens.apps.custom import instrument", the retriever stops working. Given below is the minimum code to reproduce the error. from trulens.apps.custom imp...
https://stackoverflow.com/questions/79196883/langchain-chroma-retrieve-not-working-with-trulens-instrument
testing, langchain, large-language-model, chromadb, rag
1,731,835,413
se_79022250
stackoverflow
ARTIFICIAL_INTELLIGENCE
How is the automatic tools choosing implemented in LangChain?
How is the automatic tools choosing implemented in LangChain? There is a topic about building an agent in LangChain docs. It says that the following code: from langchain_community.tools.tavily_search import TavilySearchResults from langchain_core.messages import HumanMessage from langchain_openai import ChatOpenAI se...
https://stackoverflow.com/questions/79022250/how-is-the-automatic-tools-choosing-implemented-in-langchain
langchain, large-language-model, vector-database
1,727,258,325
se_78638290
stackoverflow
ARTIFICIAL_INTELLIGENCE
Client error '404 Not Found' for url 'http://localhost:11434/api/chat' while using ReActAgent of llama_index.core.agent
Client error '404 Not Found' for url 'http://localhost:11434/api/chat' while using ReActAgent of llama_index.core.agent I am following this tutorial, https://youtu.be/JLmI0GJuGlY?si=eeffNvHjaRHVV6r7&t=1915, and trying to build a simple LLM agent. I am on WSL2, Windows 11, and I am coding in VSC. I use ...
https://stackoverflow.com/questions/78638290/client-error-404-not-found-for-url-http-localhost11434-api-chat-while-usi
python, windows-subsystem-for-linux, large-language-model, llama-index, ollama
1,718,723,670
se_79268318
stackoverflow
ARTIFICIAL_INTELLIGENCE
how can I implement a multiprocessing subprocess which returns a generator
how can I implement a multiprocessing subprocess which returns a generator I have a python class which are designed to perform two tasks: generate some streaming texts by calling LLM api do some mongoDB queries A sample class definition is as below: import multiprocessing from pymongo import MongoClient class Test...
https://stackoverflow.com/questions/79268318/how-can-i-implement-a-multiprocessing-subprocess-which-returns-a-generator
python, generator, python-multiprocessing, large-language-model
1,733,835,077
se_76761875
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why do I get an inconsistent memory error when loading Llama-2 from huggingface
Why do I get an inconsistent memory error when loading Llama-2 from huggingface I'm playing around with the new Llama-2 7B model, and running it on a 16GM RAM M1 pro Mac. If I load the model, Python crashes with a memory error - unless I load it via hf pipelines. I don't believe this to be a hf issue but rather someth...
https://stackoverflow.com/questions/76761875/why-do-i-get-an-inconsistent-memory-error-when-loading-llama-2-from-huggingface
memory, huggingface-transformers, huggingface, large-language-model, llama-index
1,690,281,562
se_77685719
stackoverflow
ARTIFICIAL_INTELLIGENCE
Latency metric failing when evaluating a model with multiple output columns
Latency metric failing when evaluating a model with multiple output columns I am building a RAG system on Azure Databricks and having trouble evaluating the pyfunc models we are saving to MLflow. The predict method of the model class outputs a pandas dataframe with three columns: answers , sources and prompts for audi...
https://stackoverflow.com/questions/77685719/latency-metric-failing-when-evaluating-a-model-with-multiple-output-columns
azure-databricks, mlflow, large-language-model, retrieval-augmented-generation
1,702,994,295
se_79257787
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to get intermediary chain step outputs in final output?
How to get intermediary chain step outputs in final output? For simplicity sake I have the following chain: extract names from a list validate these names against a second list of names What I want is to receive a JSON with all intermediary steps at the end as well as the input: {"first_value": "Dave, John, carrot",...
https://stackoverflow.com/questions/79257787/how-to-get-intermediary-chain-step-outputs-in-final-output
langchain, large-language-model, chain
1,733,483,755
se_79262426
stackoverflow
ARTIFICIAL_INTELLIGENCE
Vertex AI Text Embedding model forbidden
Vertex AI Text Embedding model forbidden I am trying to run the tutorial here about text embedding on GCP : https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings?hl=fr However, the code snippet below does not work (the error message indicates a disabled service while Vertex AI API is act...
https://stackoverflow.com/questions/79262426/vertex-ai-text-embedding-model-forbidden
python, google-cloud-platform, large-language-model, google-cloud-vertex-ai, rag
1,733,659,930
se_79261200
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to resolve the meta-3b-instruct Auth Error error while executing a web app on Streamlit Cloud using GitHub?
How to resolve the meta-3b-instruct Auth Error error while executing a web app on Streamlit Cloud using GitHub? I have been building an app in Streamlit Cloud which uses a GitHub repo to execute code. Now I am using a hugging face model in the code. I have the API key and permission granted for meta-3b-instruct and 8b...
https://stackoverflow.com/questions/79261200/how-to-resolve-the-meta-3b-instruct-auth-error-error-while-executing-a-web-app-o
python, github, huggingface-transformers, streamlit, large-language-model
1,733,597,939
se_77068414
stackoverflow
ARTIFICIAL_INTELLIGENCE
QA'ing a web page using a Retriever (LangChain) - disappointing results
QA'ing a web page using a Retriever (LangChain) - disappointing results I've been learning about using LangChain to build a simple app to QA a document/web page, I've been using these tutorials: https://python.langchain.com/docs/use_cases/question_answering/how_to/vector_db_qa https://python.langchain.com/docs/int...
https://stackoverflow.com/questions/77068414/qaing-a-web-page-using-a-retriever-langchain-disappointing-results
langchain, large-language-model, chromadb
1,694,189,294
se_77607529
stackoverflow
ARTIFICIAL_INTELLIGENCE
Output probabilities of tokens generated by Llama 2 using Transformers
Output probabilities of tokens generated by Llama 2 using Transformers Given input tokens, LLMs output the tokens in their vocabulary that have the highest probability of coming after the input tokens. I would like to print the probability of each token generated by the model in response to a prompt to see how confide...
https://stackoverflow.com/questions/77607529/output-probabilities-of-tokens-generated-by-llama-2-using-transformers
nlp, huggingface-transformers, large-language-model, llama
1,701,791,429
se_79254402
stackoverflow
ARTIFICIAL_INTELLIGENCE
How can I run batch predictions with few shot examples in Vertex AI?
How can I run batch predictions with few shot examples in Vertex AI? I understand from the documentation that my inputs should have the following format: { "request":{ "contents": [ {"role": "user", "parts": [ {"text": "What is the relation between the following video and image samples?"} {...
https://stackoverflow.com/questions/79254402/how-can-i-run-batch-predictions-with-few-shot-examples-in-vertex-ai
google-cloud-platform, batch-processing, large-language-model, google-cloud-vertex-ai, google-gemini
1,733,396,804
se_77559884
stackoverflow
ARTIFICIAL_INTELLIGENCE
I am getting an error while trying to run autogen using a local LLM
I am getting an error while trying to run autogen using a local LLM Below is the Code I am running. Note that I am using LM Studio (LLM: Llama 2) and I have double checked to make sure that the server number is correct. from autogen import AssistantAgent, UserProxyAgent config_list = [ { "api_type": "open...
https://stackoverflow.com/questions/77559884/i-am-getting-an-error-while-trying-to-run-autogen-using-a-local-llm
python, artificial-intelligence, typeerror, large-language-model, ms-autogen
1,701,118,439
se_79253279
stackoverflow
ARTIFICIAL_INTELLIGENCE
Build a GraphRag with PostGreSQL and Apache AGE Extension
Build a GraphRag with PostGreSQL and Apache AGE Extension I'm trying to understand if it's possible to use PostgreSQL as a GraphRAG. As far as I understand, GraphRAG allows hybrid retrieval that combines vector search and graph search. It feels like Apache AGE can do graph research and PostgreSQL can store vectors, bu...
https://stackoverflow.com/questions/79253279/build-a-graphrag-with-postgresql-and-apache-age-extension
postgresql, large-language-model, apache-age, graphrag
1,733,367,733
se_79253601
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to use tools with LLMs?
How to use tools with LLMs? I am using the stream interface of completions, e.g. const completion = await client.chat.completions.create({ messages, model: '...', stream: true, stream_options: { include_usage: true, }, tool_choice: { type: 'function', function: { name: 'searchWeb', }...
https://stackoverflow.com/questions/79253601/how-to-use-tools-with-llms
typescript, openai-api, large-language-model
1,733,380,182
se_78800294
stackoverflow
ARTIFICIAL_INTELLIGENCE
CUDA Out of Memory Error Despite Having Multiple GPUs
CUDA Out of Memory Error Despite Having Multiple GPUs I'm encountering a CUDA out-of-memory error while trying to run a PyTorch model, even though my system has multiple NVIDIA GPUs. # Load the tokenizer and model tokenizer = AutoTokenizer.from_pretrained("MODEL_TYPE") model = AutoModelForCausalLM.from_pretrained("MOD...
https://stackoverflow.com/questions/78800294/cuda-out-of-memory-error-despite-having-multiple-gpus
machine-learning, pytorch, gpu, huggingface-transformers, large-language-model
1,722,042,885
se_79234004
stackoverflow
ARTIFICIAL_INTELLIGENCE
Llama-3.2-1B-Instruct generate inconsistent output
Llama-3.2-1B-Instruct generate inconsistent output I want to use Llama-3.2-1B-Instruct model, and although I have set "temperature": 0.0, "top_p":0.0 and "top_k":0, it still generates inconsistent output. This is how my pipeline looks like: pipe = pipeline( "text-generation", model=model_id, torch_dtype=to...
https://stackoverflow.com/questions/79234004/llama-3-2-1b-instruct-generate-inconsistent-output
python, nlp, huggingface-transformers, large-language-model
1,732,798,957
se_79230168
stackoverflow
ARTIFICIAL_INTELLIGENCE
My scrollbar glitches as new chat is streamed from LLM in Streamlit
My scrollbar glitches as new chat is streamed from LLM in Streamlit I am creating a Streamlit chat application that helps communicate with a model similar to ChatGPT. I am trying to stream the response from the LLM but whenever the response is streamed, the chat glitches and jerks to the top sometimes. I noticed that ...
https://stackoverflow.com/questions/79230168/my-scrollbar-glitches-as-new-chat-is-streamed-from-llm-in-streamlit
python, chatbot, streamlit, large-language-model
1,732,708,660
se_77404935
stackoverflow
ARTIFICIAL_INTELLIGENCE
PEFT LoRA Trainer No executable batch size found
PEFT LoRA Trainer No executable batch size found I'm trying to fine tune the model weights from a FLAN-T5 model downloaded from hugging face. I'm trying to do this with PEFT and specifically LoRA. I'm using the code below. I'm getting an error "No executable batch size found, reached zero". It seems to be related ...
https://stackoverflow.com/questions/77404935/peft-lora-trainer-no-executable-batch-size-found
python-3.x, large-language-model, peft
1,698,864,486
se_79233741
stackoverflow
ARTIFICIAL_INTELLIGENCE
profiling of Llama 3.1 8B model on AI Accelerator
profiling of Llama 3.1 8B model on AI Accelerator I have the profiling results of the inference of Llama 3.1 8b model by Meta. I deployed the model on the AI Accelerator. I managed to create a memory trace of the whole model from the Host to the device. I managed to map the each layer and each segment of the model wi...
https://stackoverflow.com/questions/79233741/profiling-of-llama-3-1-8b-model-on-ai-accelerator
gpu, artificial-intelligence, profiling, large-language-model, transformer-model
1,732,794,148
se_79204529
stackoverflow
ARTIFICIAL_INTELLIGENCE
Unable to figure out the hardware requirement(Cloud or on-prem) for open source inference for multiple users
Unable to figure out the hardware requirement(Cloud or on-prem) for open source inference for multiple users I am trying to budget for setting up a llm based RAG application which will serve users with dynamic size(Anything from 100 to 2000). I am able to figure out the GPU requirement to host a certain llm[1], let's ...
https://stackoverflow.com/questions/79204529/unable-to-figure-out-the-hardware-requirementcloud-or-on-prem-for-open-source
python-3.x, large-language-model, transformer-model, inference, llama
1,732,038,609
se_78231114
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to use langchain load_evaluator() with local llm?
How to use langchain load_evaluator() with local llm? I try to use langchain load_evaluator() with local LLM Ollama. But I don't understand which model I should use. from langchain.evaluation import load_evaluator from langchain.chat_models import ChatOllama from langchain.llms import Ollama from langchain.embeddings ...
https://stackoverflow.com/questions/78231114/how-to-use-langchain-load-evaluator-with-local-llm
langchain, large-language-model
1,711,536,760
se_79180131
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to parse a resume with few shot method using the specified models from HuggingFace and Langchain?
How to parse a resume with few shot method using the specified models from HuggingFace and Langchain? Model selection confusion and some errors while trying to parse a resume with the following codes Trying to do a few shot prompting with a google flan t5 base model While Doing so I am getting an error ERROR:Service....
https://stackoverflow.com/questions/79180131/how-to-parse-a-resume-with-few-shot-method-using-the-specified-models-from-huggi
nlp, prompt, langchain, large-language-model, huggingface
1,731,396,000
se_79211363
stackoverflow
ARTIFICIAL_INTELLIGENCE
suggestions for resolving an ambiguity in a system
suggestions for resolving an ambiguity in a system I have a huge dataset containing information about painters, divers, drivers, electricians, chefs, gardeners, and many more, including the different types of work they can do and other related conditions. Based on this data, there are corresponding prices for each typ...
https://stackoverflow.com/questions/79211363/suggestions-for-resolving-an-ambiguity-in-a-system
python, openai-api, prompt, large-language-model, ambiguity
1,732,195,552
se_78895710
stackoverflow
ARTIFICIAL_INTELLIGENCE
NER versus LLM to extract name, gender, role and company from text
NER versus LLM to extract name, gender, role and company from text I need to extract the name, gender, job title and employer/company name from newspaper articles, running the process on local hardware (no Cloud allowed) due to copyright reasons. I've been playing around with Llama 3.1 but I'm finding I don't get usea...
https://stackoverflow.com/questions/78895710/ner-versus-llm-to-extract-name-gender-role-and-company-from-text
nlp, large-language-model, named-entity-recognition
1,724,225,953
se_79228580
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to use Groq Api in Java for an Android App (Android Studio)?
How to use Groq Api in Java for an Android App (Android Studio)? I have already used groq api in python, to inference with LLMs. Now I wonder wether it would be possible to do the same with Java. I have already found this curl script. Can I use it in an Android App? Or would there be an better way to do it? curl https...
https://stackoverflow.com/questions/79228580/how-to-use-groq-api-in-java-for-an-android-app-android-studio
android, curl, large-language-model
1,732,664,690
se_79221167
stackoverflow
ARTIFICIAL_INTELLIGENCE
blip2 type mismatch exception
blip2 type mismatch exception I'm trying to create an image captioning model using hugging face blip2 model on colab. My code was working fine till last week (Nov 8) but it gives me an exception now. To install packages I use the following command: !pip install -q git+https://github.com/huggingface/peft.git transforme...
https://stackoverflow.com/questions/79221167/blip2-type-mismatch-exception
python, artificial-intelligence, huggingface-transformers, large-language-model
1,732,485,923
se_79111773
stackoverflow
ARTIFICIAL_INTELLIGENCE
litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call
litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call I'm getting the following error: ERROR: LiteLLM call failed: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=model='models/gemini-1.5-flash' google_...
https://stackoverflow.com/questions/79111773/litellm-badrequesterror-llm-provider-not-provided-pass-in-the-llm-provider-you
langchain, large-language-model, agent, google-gemini, crewai
1,729,544,970
se_79225659
stackoverflow
ARTIFICIAL_INTELLIGENCE
What should I pass in retriever parameter in ConversationalRetrievalChain function to create a conversational bot
What should I pass in retriever parameter in ConversationalRetrievalChain function to create a conversational bot I am creating a chatbot which generates oracle query based upon the user question. I have provided the table structures and other DB related things in the SystemMessage and user question in HumanMessage. I...
https://stackoverflow.com/questions/79225659/what-should-i-pass-in-retriever-parameter-in-conversationalretrievalchain-functi
python, memory, langchain, large-language-model
1,732,605,069
se_77805528
stackoverflow
ARTIFICIAL_INTELLIGENCE
Langchain Hub pull ChatPromptTemplate returns False
Langchain Hub pull ChatPromptTemplate returns False I was trying to follow the quickstart tutorial for agents for Langchain: https://js.langchain.com/docs/modules/agents/quick_start I followed the process but faced unexpected errors. I did not know how to solve it and did not find any existing solution. Please advise....
https://stackoverflow.com/questions/77805528/langchain-hub-pull-chatprompttemplate-returns-false
agent, langchain, large-language-model
1,705,051,282
se_79217649
stackoverflow
ARTIFICIAL_INTELLIGENCE
Text extraction from PDF , ConnectError: [WinError 10061] No connection could be made because the target machine actively refused it
Text extraction from PDF , ConnectError: [WinError 10061] No connection could be made because the target machine actively refused it I'm trying to extract tables and text from pdf and them ask questions regarding the pdf's with the help of llms . However when i run the code , it shows 10061 error , I think this is bec...
https://stackoverflow.com/questions/79217649/text-extraction-from-pdf-connecterror-winerror-10061-no-connection-could-be
python, large-language-model, python-camelot, pdf-extraction
1,732,358,851
se_75837803
stackoverflow
ARTIFICIAL_INTELLIGENCE
Streaming ChatGPT's results with Flask and LangChain
Streaming ChatGPT's results with Flask and LangChain Basically I want to achieve this with Flask and LangChain: https://www.youtube.com/watch?v=x8uwwLNxqis. I'm building a Q&A Flask app that uses LangChain in the backend, but I'm having trouble to stream the response from ChatGPT. My chain looks like this: chain =...
https://stackoverflow.com/questions/75837803/streaming-chatgpts-results-with-flask-and-langchain
python, flask, openai-api, langchain, large-language-model
1,679,688,838
se_79213090
stackoverflow
ARTIFICIAL_INTELLIGENCE
Memory bottleneck when tokenizing large datasets with Hugging Face’s AutoTokenizer
Memory bottleneck when tokenizing large datasets with Hugging Face’s AutoTokenizer I’m encountering a memory bottleneck when tokenizing large datasets with Hugging Face’s AutoTokenizer for LLM pretraining. Despite using batch_encode_plus with truncation, the process intermittently crashes. Are there strategies or tool...
https://stackoverflow.com/questions/79213090/memory-bottleneck-when-tokenizing-large-datasets-with-hugging-face-s-autotokeniz
python, artificial-intelligence, large-language-model
1,732,228,038
se_79039544
stackoverflow
ARTIFICIAL_INTELLIGENCE
OpenAI API error: "Invalid parameter: 'response_format' of type 'json_schema' is not supported with model version `gpt-4-turbo`"
OpenAI API error: "Invalid parameter: 'response_format' of type 'json_schema' is not supported with model version `gpt-4-turbo`" From the main page and official documentation, OpenAI clearly mentioned we can use the response_format as follows: What I'm trying in Postman is the following: { ...
https://stackoverflow.com/questions/79039544/openai-api-error-invalid-parameter-response-format-of-type-json-schema-is
json, openai-api, large-language-model, gpt-4, openai-assistants-api
1,727,702,419
se_78473568
stackoverflow
ARTIFICIAL_INTELLIGENCE
Pinecone serverless from existing index
Pinecone serverless from existing index from flask import Flask, render_template, jsonify, request from src.helper import download_hugging_face_embeddings # from langchain.vectorstores import Pinecone import pinecone from langchain.prompts import PromptTemplate from langchain.llms import CTransformers from langchain.c...
https://stackoverflow.com/questions/78473568/pinecone-serverless-from-existing-index
artificial-intelligence, chatbot, large-language-model, pinecone
1,715,617,014
se_79205965
stackoverflow
ARTIFICIAL_INTELLIGENCE
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:3 and cuda:0
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:3 and cuda:0 I want to fine-tune Llama 3.1 large language model with a new datasets, but when I try to use multiple GPUs to train the model, I kept getting the following error message: RuntimeError: Expected all tensors t...
https://stackoverflow.com/questions/79205965/runtimeerror-expected-all-tensors-to-be-on-the-same-device-but-found-at-least
pytorch, gpu, artificial-intelligence, large-language-model, llama
1,732,082,363
se_79205866
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why my trained t5-small model generate a mess after I saved and loaded the checkpoint?
Why my trained t5-small model generate a mess after I saved and loaded the checkpoint? I was distilling my student model (base model t5-small) based on a fine-tuned T5-xxl. Here is the config student_model = AutoModelForSeq2SeqLM.from_pretrained( args.student_model_name_or_path, torch_dtype=torch.float32, ...
https://stackoverflow.com/questions/79205866/why-my-trained-t5-small-model-generate-a-mess-after-i-saved-and-loaded-the-check
large-language-model, transformer-model, checkpoint
1,732,078,939
se_77031060
stackoverflow
ARTIFICIAL_INTELLIGENCE
Query bot on multiple JSON files on Langchain
Query bot on multiple JSON files on Langchain I have around 30 GB of JSON data with multiple files, wanted build query bot on this. I have built same with text file but i am not sure how it will work for JSON data. I have explored JSONLoader but dont know how to use this to convert JSON data into vector and store it i...
https://stackoverflow.com/questions/77031060/query-bot-on-multiple-json-files-on-langchain
python, langchain, large-language-model, chromadb, jsonloader
1,693,720,018
se_77550536
stackoverflow
ARTIFICIAL_INTELLIGENCE
Do LLM models generate output token by token?
Do LLM models generate output token by token? If you use ChatGPT web app it answers typing token by token. It you use it through API you get the whole answer at once. My assumption was that they provide token by token answers in the web app for UX reasons (easier reading maybe, a sneaky way to limit the amount of user...
https://stackoverflow.com/questions/77550536/do-llm-models-generate-output-token-by-token
large-language-model, llama, gpt-4
1,700,975,768
se_79163430
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to use Google Search Grounding with Dynamic Retrieval Configuration
How to use Google Search Grounding with Dynamic Retrieval Configuration I'm trying to use Google Search for grounding in Vertex AI with dynamic retrieval configuration, but I'm encountering issues with the Tool.from_google_search_retrieval method. from vertexai.generative_models import Tool, grounding tool = Tool.fro...
https://stackoverflow.com/questions/79163430/how-to-use-google-search-grounding-with-dynamic-retrieval-configuration
google-cloud-platform, large-language-model, google-search, google-cloud-vertex-ai, google-gemini
1,730,910,050
se_79200200
stackoverflow
ARTIFICIAL_INTELLIGENCE
Llama using up all RAM storage causing kernel to die
Llama using up all RAM storage causing kernel to die import os import torch from datasets import load_dataset from transformers import ( AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TrainingArguments, pipeline, logging, ) from peft import L...
https://stackoverflow.com/questions/79200200/llama-using-up-all-ram-storage-causing-kernel-to-die
python, large-language-model, llama
1,731,937,980
se_79163094
stackoverflow
ARTIFICIAL_INTELLIGENCE
Marking Agent output as `HumanMessage` in LangChain
Marking Agent output as `HumanMessage` in LangChain Why does the agent_node saves the LLM output as HumanMessage in this example? from typing import List, Optional from langchain.output_parsers.openai_functions import JsonOutputFunctionsParser from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder ...
https://stackoverflow.com/questions/79163094/marking-agent-output-as-humanmessage-in-langchain
langchain, large-language-model, langgraph
1,730,904,072
se_78725580
stackoverflow
ARTIFICIAL_INTELLIGENCE
ModuleNotFoundError when importing HuggingFaceLLM from llama_index.core.llms.huggingface
ModuleNotFoundError when importing HuggingFaceLLM from llama_index.core.llms.huggingface I’m trying to import HuggingFaceLLM using the following line of code: from llama_index.core.llms.huggingface import HuggingFaceLLM I know that llamaindex keeps updating, and previously this import worked with: from llama_index.ll...
https://stackoverflow.com/questions/78725580/modulenotfounderror-when-importing-huggingfacellm-from-llama-index-core-llms-hug
large-language-model, huggingface, llama-index
1,720,527,901
se_77719186
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to create isolated session for ConversationBufferMemory per user in Langchain?
How to create isolated session for ConversationBufferMemory per user in Langchain? Problem Statement I wish to create a FastAPI endpoint with isolated users sessions for my LLM, which is using ConversationBufferMemory. This memory will serve as context for conversation between the AI and the user. Currently, it's been...
https://stackoverflow.com/questions/77719186/how-to-create-isolated-session-for-conversationbuffermemory-per-user-in-langchai
session, caching, chatbot, large-language-model, py-langchain
1,703,626,836
se_78397825
stackoverflow
ARTIFICIAL_INTELLIGENCE
Running LLMs locally causing this error: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing
Running LLMs locally causing this error: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing I have the following code to send a prompt request to a local LLM, ph-3. Although it shows the correct response in LM studio (check the image), on the VS I receive timeout error. Any help?...
https://stackoverflow.com/questions/78397825/running-llms-locally-causing-this-error-the-request-was-canceled-due-to-the-con
c#, large-language-model, semantic-kernel, lm-studio
1,714,299,689
se_78437376
stackoverflow
ARTIFICIAL_INTELLIGENCE
run `!ollama run llama3` in colab raise err "Error: could not connect to ollama app, is it running?"
run `!ollama run llama3` in colab raise err "Error: could not connect to ollama app, is it running?" I use following code !apt install pciutils -y !curl -fsSL https://ollama.com/install.sh | sh !ollama run llama3 in !ollama run llama3 code cell, it raise err "Error: could not connect to ollama app, is it ru...
https://stackoverflow.com/questions/78437376/run-ollama-run-llama3-in-colab-raise-err-error-could-not-connect-to-ollama
artificial-intelligence, google-colaboratory, large-language-model, llama
1,715,006,472
se_79181984
stackoverflow
ARTIFICIAL_INTELLIGENCE
OutOfMemoryError when increasing context_length of LLMs
OutOfMemoryError when increasing context_length of LLMs I'm trying to train a model with a context length of 50,000 using PyTorch's Fully Sharded Data Parallel (FSDP) but I keep running into an OutOfMemoryError regardless of how many GPUs are available. Here is the llama-recipes command I am using to train the model: ...
https://stackoverflow.com/questions/79181984/outofmemoryerror-when-increasing-context-length-of-llms
pytorch, large-language-model, llama, multi-gpu
1,731,429,259
se_79167574
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why are model_q4.onnx and model_q4f16.onnx not 4 times smaller than model.onnx?
Why are model_q4.onnx and model_q4f16.onnx not 4 times smaller than model.onnx? I see on https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct/tree/main/onnx: File Name Size model.onnx 654 MB model_fp16.onnx 327 MB model_q4.onnx 200 MB model_q4f16.onnx 134 MB I understand that: model.onnx is the ...
https://stackoverflow.com/questions/79167574/why-are-model-q4-onnx-and-model-q4f16-onnx-not-4-times-smaller-than-model-onnx
deep-learning, large-language-model, huggingface, onnx, quantization
1,731,001,957
se_79165072
stackoverflow
ARTIFICIAL_INTELLIGENCE
Getting Document Similarity Scores with SelfQueryRetriever - Langchain
Getting Document Similarity Scores with SelfQueryRetriever - Langchain I want to be able to get the similarity scores of the retrieved documents when using the SelfQueryRetriever as seen below. I have made a selfquery retriever as follows: retriever = SelfQueryRetriever.from_llm( llm = llm, vectorstore = vecto...
https://stackoverflow.com/questions/79165072/getting-document-similarity-scores-with-selfqueryretriever-langchain
python, machine-learning, large-language-model, py-langchain, rag
1,730,955,717
se_79173053
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to convert character indices to BERT token indices
How to convert character indices to BERT token indices I am working with a question-answer dataset UCLNLP/adversarial_qa. from datasets import load_dataset ds = load_dataset("UCLNLP/adversarial_qa", "adversarialQA") How do I map character-based answer indices to token-based indices after tokenizing the context and qu...
https://stackoverflow.com/questions/79173053/how-to-convert-character-indices-to-bert-token-indices
python, nlp, dataset, large-language-model, bert-language-model
1,731,165,333
se_78743278
stackoverflow
ARTIFICIAL_INTELLIGENCE
DSPy: How to get the number of tokens available for the input fields?
DSPy: How to get the number of tokens available for the input fields? This is a cross-post from Issue #1245 of DSPy GitHub Repo. There were no responses in the past week, am I am working on a project with a tight schedule. When running a DSPy module with a given signature, I am interested in getting the token count of...
https://stackoverflow.com/questions/78743278/dspy-how-to-get-the-number-of-tokens-available-for-the-input-fields
python, large-language-model, language-model, retrieval-augmented-generation, dspy
1,720,859,159
se_79173232
stackoverflow
ARTIFICIAL_INTELLIGENCE
LangChain OutputParserException with SQL Agent using Bedrock Model in Node.js
LangChain OutputParserException with SQL Agent using Bedrock Model in Node.js I'm integrating a SQL agent with LangChain in a Node.js application using the AWS Bedrock model (us.meta.llama3-2-1b-instruct-v1:0) for natural language to SQL conversion. Database: PostgreSQL Environment: Node.js (Express-based backend) Mul...
https://stackoverflow.com/questions/79173232/langchain-outputparserexception-with-sql-agent-using-bedrock-model-in-node-js
langchain, large-language-model, llama, amazon-bedrock, llama3
1,731,170,453
se_78272521
stackoverflow
ARTIFICIAL_INTELLIGENCE
Hugging Face Prompt Injection Identifier
Hugging Face Prompt Injection Identifier packages versions langchain==0.1.14 langchain-community==0.0.31 langchain-core==0.1.38 langchain-experimental==0.0.56 pydantic==1.10.14 I am attempting to utilize prompt injection identification following the guidelines outlined in the tutorial linked here. Here's the code sn...
https://stackoverflow.com/questions/78272521/hugging-face-prompt-injection-identifier
python, prompt, langchain, large-language-model
1,712,218,133
se_79157221
stackoverflow
ARTIFICIAL_INTELLIGENCE
LLM - Add n-shot prompting in dify (pdf)
LLM - Add n-shot prompting in dify (pdf) I'm using Dify and would like to improve my workflow by adding a One-shot prompting. The workflow is very simple: Upload file (pdf) Extract data from pdf -> output "text" Send output "text" to the Ollama model & Ask questions (extract invoice ID, customer reference etc..) Ret...
https://stackoverflow.com/questions/79157221/llm-add-n-shot-prompting-in-dify-pdf
large-language-model, ollama
1,730,761,006
se_79015381
stackoverflow
ARTIFICIAL_INTELLIGENCE
InvokeAgent API - Send images to AWS BEDROCK Agent
InvokeAgent API - Send images to AWS BEDROCK Agent Is there a way I can send image files as base64 or s3 repository link to a BedRock Agent using InvokeAgent API? I've noted that in the syntax we have this part: response = client.invoke_agent( agentAliasId='string', agentId='string', enableTrace=True|False...
https://stackoverflow.com/questions/79015381/invokeagent-api-send-images-to-aws-bedrock-agent
python, file-upload, large-language-model, amazon-bedrock
1,727,106,637
se_79167124
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to Customize Input/Output Variable Names in LangChain Multi-Step SQL Query Chain?
How to Customize Input/Output Variable Names in LangChain Multi-Step SQL Query Chain? I’m setting up a LangChain workflow to generate, validate, execute, and format SQL queries in multiple steps: Generate SQL Query - Create an SQL query from user input. Validate the Query - Prompt the LLM with the user question, data...
https://stackoverflow.com/questions/79167124/how-to-customize-input-output-variable-names-in-langchain-multi-step-sql-query-c
sql, prompt, langchain, large-language-model
1,730,993,125
se_79148668
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to index 1000 .py files in multiple subdirectories to a vector database & make RAG leverage the folder structure?
How to index 1000 .py files in multiple subdirectories to a vector database & make RAG leverage the folder structure? There 1000s of .py files from 20 different projects. The directory structure is as follows code base root folder * common libaries1 * common libaries2 * common libaries3 * project1 * project2 * pro...
https://stackoverflow.com/questions/79148668/how-to-index-1000-py-files-in-multiple-subdirectories-to-a-vector-database-ma
langchain, large-language-model, vector-database, rag, haystack
1,730,476,629
se_79122056
stackoverflow
ARTIFICIAL_INTELLIGENCE
Dataset format/ prompt template for fine tuning Qwen 2.5-Coder Instruct
Dataset format/ prompt template for fine tuning Qwen 2.5-Coder Instruct I see that codellama 7B Instruct has the following prompt template: <s>[INST] <<SYS>>\n{context}\n<</SYS>>\n\n{question} [/INST] {answer} </s> But I could not find what the prompt template should I use for Qwen 2.5-Coder 7B Instruct. I am really ...
https://stackoverflow.com/questions/79122056/dataset-format-prompt-template-for-fine-tuning-qwen-2-5-coder-instruct
prompt, large-language-model, fine-tuning
1,729,775,467
se_79155696
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to Speed Up Document Retrieval with llama_index Using a Local Model in Jupyter Notebook?
How to Speed Up Document Retrieval with llama_index Using a Local Model in Jupyter Notebook? I'm working on a project that uses llama_index to retrieve document information in Jupyter Notebook, but I'm experiencing very slow query response times (around 15 minutes per query). I'm using the following code: from llama_i...
https://stackoverflow.com/questions/79155696/how-to-speed-up-document-retrieval-with-llama-index-using-a-local-model-in-jupyt
python, large-language-model, llama-index, ollama, llama3
1,730,728,312
se_78758312
stackoverflow
ARTIFICIAL_INTELLIGENCE
DSPy can&#39;t retrieve passage with text embeddings in ChromaDB
DSPy can&#39;t retrieve passage with text embeddings in ChromaDB I am working on a RAG application using DSPy and ChromaDB for pdf files. At first I fetched the text from the pdf and add it to the Chromadb as chunks. Also added the embeddings of the chunks. And tried to Retrieve the chunk that is related to the query ...
https://stackoverflow.com/questions/78758312/dspy-cant-retrieve-passage-with-text-embeddings-in-chromadb
machine-learning, nlp, large-language-model, chromadb, dspy
1,721,203,410
se_78677557
stackoverflow
ARTIFICIAL_INTELLIGENCE
Using a text embedding model locally with semantic kernel
Using a text embedding model locally with semantic kernel I've been reading Stephen Toub's blog post about building a simple console-based .NET chat application from the ground up with semantic-kernel. I'm following the examples but instead of OpenAI I want to use microsoft Phi 3 and the nomic embedding model. The fir...
https://stackoverflow.com/questions/78677557/using-a-text-embedding-model-locally-with-semantic-kernel
c#, large-language-model, semantic-kernel, semantic-kernel-plugins
1,719,490,180
se_78537177
stackoverflow
ARTIFICIAL_INTELLIGENCE
How do I add debugging statements inside a plugin that I am making for TaskWeaver?
How do I add debugging statements inside a plugin that I am making for TaskWeaver? I am playing around with TaskWeaver and I want to develop a plugin in it. I want to be able to add debug statements. However, since the plugin code is run by the code interpreter and now directly through my terminal, simply adding print...
https://stackoverflow.com/questions/78537177/how-do-i-add-debugging-statements-inside-a-plugin-that-i-am-making-for-taskweave
openai-api, large-language-model
1,716,784,005
se_78879743
stackoverflow
ARTIFICIAL_INTELLIGENCE
RAG spring AI on simple database table not finding data with llama3 model
RAG spring AI on simple database table not finding data with llama3 model When I try to use spring AI to query a table using ollama3 model I get bad results. It seems my data is not used. The table "Accedant" is very simple. It contains a name, firstname and email (in french language). All the code is here in this pac...
https://stackoverflow.com/questions/78879743/rag-spring-ai-on-simple-database-table-not-finding-data-with-llama3-model
spring, large-language-model, llama, spring-ai
1,723,820,683
se_79138919
stackoverflow
ARTIFICIAL_INTELLIGENCE
Deploying LLM from S3 on Amazon SageMaker
Deploying LLM from S3 on Amazon SageMaker I trained Llama 2 7B and was trying to deploy the model on SageMaker. from sagemaker.huggingface import HuggingFaceModel model_s3_path = 's3://bucket/model/model.tar.gz' # sagemaker config instance_type = "ml.g4dn.2xlarge" number_of_gpu = 1 health_check_timeout = 300 image...
https://stackoverflow.com/questions/79138919/deploying-llm-from-s3-on-amazon-sagemaker
amazon-web-services, amazon-sagemaker, large-language-model
1,730,234,191
se_79060002
stackoverflow
ARTIFICIAL_INTELLIGENCE
Model Loader errors in Text Gen Web UI`
Model Loader errors in Text Gen Web UI` I have tried loading multiple models from HuggingFace using Text Gen Web UI, but no matter the model or the loader, I get the same "ModuleNotFoundError" for the loaders. Importantly, I am using an Intel i7 and not a GPU, but I have been able to run smaller models using different...
https://stackoverflow.com/questions/79060002/model-loader-errors-in-text-gen-web-ui
python, large-language-model, huggingface
1,728,245,497
se_79143863
stackoverflow
ARTIFICIAL_INTELLIGENCE
Issue installing langchain package – numpy metadata generation failed due to missing compiler
Issue installing langchain package – numpy metadata generation failed due to missing compiler I am attempting to install the langchain package in my Python virtual environment on Windows, but I encounter an error when it tries to install numpy. The error seems to be related to a failure in generating the package metad...
https://stackoverflow.com/questions/79143863/issue-installing-langchain-package-numpy-metadata-generation-failed-due-to-mis
python, numpy, langchain, large-language-model, rag
1,730,361,544
se_79139619
stackoverflow
ARTIFICIAL_INTELLIGENCE
Kong AI Proxy Plugin: Correct Parameters for Configuring a Self-Hosted LLM on Kong AI Gateway
Kong AI Proxy Plugin: Correct Parameters for Configuring a Self-Hosted LLM on Kong AI Gateway (This question relates to using Kong API Gateway as a way to offer multiple LLM APIs as a service) I have a number of self-hosted LLMs which I want to access via Kong's AI Gateway (i.e "A.I Proxy Plugin"). Each self-hosted LL...
https://stackoverflow.com/questions/79139619/kong-ai-proxy-plugin-correct-parameters-for-configuring-a-self-hosted-llm-on-ko
machine-learning, large-language-model, kong, kong-plugin
1,730,260,486
se_79140580
stackoverflow
ARTIFICIAL_INTELLIGENCE
&quot;Connection Refused&quot; Issue while running ollama in container with LLM Chat bot app in another docker Container
&quot;Connection Refused&quot; Issue while running ollama in container with LLM Chat bot app in another docker Container I have created a local chatbot in python 3.12 that allows user to chat with pdf uploaded by creating embeddings in qdrant vector database and further getting inference from ollama (Model LLama3.2:3B...
https://stackoverflow.com/questions/79140580/connection-refused-issue-while-running-ollama-in-container-with-llm-chat-bot-a
docker, dockerfile, large-language-model, ollama, qdrant
1,730,282,608
se_79140562
stackoverflow
ARTIFICIAL_INTELLIGENCE
Cohere method chat_stream does not accept &#39;messages&#39; parameter
Cohere method chat_stream does not accept &#39;messages&#39; parameter I am currently training myself in using the Cohere API. I am following the training course Building a chatbot. You can find my code below. According to the API Refence, I should be able to pass the argument 'messages' to the method chat_stream But ...
https://stackoverflow.com/questions/79140562/cohere-method-chat-stream-does-not-accept-messages-parameter
python, large-language-model
1,730,282,390
se_79132931
stackoverflow
ARTIFICIAL_INTELLIGENCE
ConnectionError when initializing BM25Assembler in DB-GPT
ConnectionError when initializing BM25Assembler in DB-GPT I'm trying to set up a simple example in DB-GPT which uses Elasticsearch as the vector store backend. This is part of the knowledge base initialization process where BM25Assembler is used for document retrieval and ranking. I have run DB-GPT with Ollama and Ela...
https://stackoverflow.com/questions/79132931/connectionerror-when-initializing-bm25assembler-in-db-gpt
python, docker, elasticsearch, large-language-model, ollama
1,730,110,583
se_78648540
stackoverflow
ARTIFICIAL_INTELLIGENCE
Streaming chat response in flatlist
Streaming chat response in flatlist I'm building a mobile app with an integrated chat that uses OpenAI API or llama3 as model. i managed to get the streaming working properly. However I have a small problem when display the message being streamed. currently the message is displayed once the streaming is done instead o...
https://stackoverflow.com/questions/78648540/streaming-chat-response-in-flatlist
react-native, expo, openai-api, large-language-model, chatgpt-api
1,718,898,955
se_79128224
stackoverflow
ARTIFICIAL_INTELLIGENCE
Cloudflare Tunnel: &quot;Unable to reach the origin service&quot; When Accessing Local HTTP API / Bad Gateway
Cloudflare Tunnel: &quot;Unable to reach the origin service&quot; When Accessing Local HTTP API / Bad Gateway I'm running a local API on port 8504 and trying to expose it via Cloudflare Tunnel. When I access the API directly with curl from my local machine, it works fine: curl "http://localhost:8504/query-stream?text=...
https://stackoverflow.com/questions/79128224/cloudflare-tunnel-unable-to-reach-the-origin-service-when-accessing-local-htt
docker-compose, cloudflare, large-language-model, tunnel
1,729,935,624
se_79119227
stackoverflow
ARTIFICIAL_INTELLIGENCE
Finetuning with Loraa and fitting my model error
Finetuning with Loraa and fitting my model error After finetuning my dataset using keras, I tried to fit the model to lora and this was the error I encountered: TypeError Traceback (most recent call last) Cell In[12], line 1 ----> 1 gemma_lm.fit(data, epochs=10, batch_size=32) File :240...
https://stackoverflow.com/questions/79119227/finetuning-with-loraa-and-fitting-my-model-error
python, large-language-model, keras-layer, model-fitting
1,729,707,906
se_76771761
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why does llama-index still require an OpenAI key when using Hugging Face local embedding model?
Why does llama-index still require an OpenAI key when using Hugging Face local embedding model? I am creating a very simple question and answer app based on documents using llama-index. Previously, I had it working with OpenAI. Now I want to try using no external APIs so I'm trying the Hugging Face example in this lin...
https://stackoverflow.com/questions/76771761/why-does-llama-index-still-require-an-openai-key-when-using-hugging-face-local-e
python, huggingface-transformers, huggingface, large-language-model, llama-index
1,690,377,586
se_79116565
stackoverflow
ARTIFICIAL_INTELLIGENCE
llm chain for llama is throwing error that input should be an instance of runnable
llm chain for llama is throwing error that input should be an instance of runnable I have the following code quantization_config = BitsAndBytesConfig(load_in_4bit=True, llm_int4_enable_fp32_cpu_offload=True) sumModel = "meta-llama/Llama-3.2-1B" llm_llama_model = AutoModelForC...
https://stackoverflow.com/questions/79116565/llm-chain-for-llama-is-throwing-error-that-input-should-be-an-instance-of-runnab
machine-learning, artificial-intelligence, langchain, large-language-model, llama
1,729,663,267
se_79115748
stackoverflow
ARTIFICIAL_INTELLIGENCE
RuntimeError - Expected All Tensors on the Same Device (CUDA and CPU)
RuntimeError - Expected All Tensors on the Same Device (CUDA and CPU) I am working on a script that runs an offsite prompt tuning model using a pre-trained Vicuna-7b model on GPU (CUDA). However, when I attempt to execute the code, I encounter the above error. It seems the tensors are not all being transferred to the ...
https://stackoverflow.com/questions/79115748/runtimeerror-expected-all-tensors-on-the-same-device-cuda-and-cpu
python, deep-learning, pytorch, runtime-error, large-language-model
1,729,631,627
se_78895938
stackoverflow
ARTIFICIAL_INTELLIGENCE
Incremental parsing of LLM output
Incremental parsing of LLM output I'm working on a service that calls a Large Language Model, parse the output, and sends the parsed output to a client, message by message. When aggregated, the stream of text coming back from the LLM looks somewhat like this: This is a reference [r1] and here's an image of a cat <imag...
https://stackoverflow.com/questions/78895938/incremental-parsing-of-llm-output
python, parsing, large-language-model
1,724,229,417
se_79111733
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to derive attributes/labels from short plain text descriptions? (NER, LLM, ?)
How to derive attributes/labels from short plain text descriptions? (NER, LLM, ?) How to derive attributes/labels from short plain text descriptions? (NER, LLM, ?) I have short product descriptions that I’d like to transform into structured attributes. Example: Input: “La Lecciaia Cabernet Sauvignon 2017 – Red – 750ml...
https://stackoverflow.com/questions/79111733/how-to-derive-attributes-labels-from-short-plain-text-descriptions-ner-llm
nlp, artificial-intelligence, large-language-model, named-entity-recognition
1,729,544,096
se_78328366
stackoverflow
ARTIFICIAL_INTELLIGENCE
create_pandas_dataframe_agent gives NameError while using COHERE llm as the agent. How should I resolve it?
create_pandas_dataframe_agent gives NameError while using COHERE llm as the agent. How should I resolve it? I am trying to use Pandas dataframe agent for data analysis a data related to cars. By default it was using OpenAI as the agent. For my use case, I had to use Cohere as the agent. I followed this documentation h...
https://stackoverflow.com/questions/78328366/create-pandas-dataframe-agent-gives-nameerror-while-using-cohere-llm-as-the-agen
pandas, langchain, large-language-model, langchain-agents
1,713,183,880
se_79099747
stackoverflow
ARTIFICIAL_INTELLIGENCE
code walkthrough of chain syntax in langchain
code walkthrough of chain syntax in langchain I am following a RAG tutorial from: https://medium.com/@vndee.huynh/build-your-own-rag-and-run-it-locally-langchain-ollama-streamlit-181d42805895 In the tutorial there is a section that creates a chain: self.chain = ({"context": self.retriever, "question": Runnable...
https://stackoverflow.com/questions/79099747/code-walkthrough-of-chain-syntax-in-langchain
python, langchain, large-language-model, retrieval-augmented-generation, rag
1,729,196,892
se_79097200
stackoverflow
ARTIFICIAL_INTELLIGENCE
Not able to download and save huggingface model - jinaai/jina-reranker-v2-base-multilingual
Not able to download and save huggingface model - jinaai/jina-reranker-v2-base-multilingual I am trying to download and save the following model from huggingface for later use. Here is the snippet. from transformers import AutoModelForSequenceClassification, AutoTokenizer,AutoModelForCausalLM model_name='jinaai/jina...
https://stackoverflow.com/questions/79097200/not-able-to-download-and-save-huggingface-model-jinaai-jina-reranker-v2-base-m
python, huggingface-transformers, large-language-model, huggingface
1,729,153,920
se_78347434
stackoverflow
ARTIFICIAL_INTELLIGENCE
Problem setting up Llama-2 in Google Colab - Cell-run fails when loading checkpoint shards
Problem setting up Llama-2 in Google Colab - Cell-run fails when loading checkpoint shards I'm trying to use Llama 2 chat (via hugging face) with 7B parameters in Google Colab (Python 3.10.12). I've already obtain my access token via Meta. I simply use the code in hugging face on how to implement the model along with ...
https://stackoverflow.com/questions/78347434/problem-setting-up-llama-2-in-google-colab-cell-run-fails-when-loading-checkpo
python, huggingface-transformers, large-language-model, llama
1,713,443,282
se_79104540
stackoverflow
ARTIFICIAL_INTELLIGENCE
getting GoogleAuthError while following a langchain tutorial
getting GoogleAuthError while following a langchain tutorial I am trying to follow an "official" langchain tutorial How to do question answering over CSVs using llm model = gemini-1.5-flash but my code is failing anyways. I am writing/running the code in Jupyter notebook. Before I executed the code, I went to my ...
https://stackoverflow.com/questions/79104540/getting-googleautherror-while-following-a-langchain-tutorial
python, large-language-model, google-cloud-vertex-ai
1,729,328,027
se_79104740
stackoverflow
ARTIFICIAL_INTELLIGENCE
Llamaindex Bug: ToolInteractiveReflectionAgentWorker not doing corrective reflection
Llamaindex Bug: ToolInteractiveReflectionAgentWorker not doing corrective reflection I tried exactly the code here line by line but with a different contents of the tool (shouldn't matter): https://docs.llamaindex.ai/en/stable/examples/agent/introspective_agent_toxicity_reduction/ https://www.youtube.com/watch?v=OLj5M...
https://stackoverflow.com/questions/79104740/llamaindex-bug-toolinteractivereflectionagentworker-not-doing-corrective-reflec
large-language-model, agent, llama-index, multi-agent, retrieval-augmented-generation
1,729,335,430
se_79047524
stackoverflow
ARTIFICIAL_INTELLIGENCE
Analysing Documents with LLAVA on Ollama not working
Analysing Documents with LLAVA on Ollama not working I am currently testing LLAVA for use in Document Understanding Tasks. I found some promissing results in some scientific papers and on some websites. I installed the Model on Ollama (on Windows) and tried accessing it with this C# Code. using System.Text; using Syst...
https://stackoverflow.com/questions/79047524/analysing-documents-with-llava-on-ollama-not-working
c#, large-language-model, ollama
1,727,883,730
se_79086528
stackoverflow
ARTIFICIAL_INTELLIGENCE
Using the libcurl library to call the large model API
Using the libcurl library to call the large model API I followed the suggestion and used the cJSON library to regenerate the data section of the message.I separately constructed the header and data parts in the message initiated by curl, and then used POST to send it out. It indicates that I have not set the model par...
https://stackoverflow.com/questions/79086528/using-the-libcurl-library-to-call-the-large-model-api
c, linux, libcurl, large-language-model
1,728,915,500
se_79081298
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to stream LangChain, LangGraph&#39;s final generation
How to stream LangChain, LangGraph&#39;s final generation How do we stream LangGraph's final generation using vercel's AI sdk? It works pretty well with LangChain LCEL as explain in this blog. But how do we do this using LangGraph and vercel ai? I am getting error TypeError: stream.pipeThrough is not a function while ...
https://stackoverflow.com/questions/79081298/how-to-stream-langchain-langgraphs-final-generation
sveltekit, langchain, large-language-model, langchain-js, langgraph
1,728,746,416
se_79087652
stackoverflow
ARTIFICIAL_INTELLIGENCE
Adding accuracy, recall and f1 metrics to SFTTrainer
Adding accuracy, recall and f1 metrics to SFTTrainer I'm working on fine tuning an LLM using SFTTrainer. For some reason, during validation phase it only yields the eval_loss. While this is nice, I actually interested also on other metrics (accuracy for example), but I wasn't able to figure out yet how to do it. I've ...
https://stackoverflow.com/questions/79087652/adding-accuracy-recall-and-f1-metrics-to-sfttrainer
python, huggingface-transformers, large-language-model, fine-tuning
1,728,938,270
se_79085165
stackoverflow
ARTIFICIAL_INTELLIGENCE
Utilize Langchain for RAG + General Knowledge
Utilize Langchain for RAG + General Knowledge I am trying to create a chatbot that takes past social media posts (only text) of users and is capable of generating new posts based on that. However, my ideal scenario here would be to use RAG but also leverage the inherent capabilities of an LLM. In my case, if I ask my ...
https://stackoverflow.com/questions/79085165/utilize-langchain-for-rag-general-knowledge
python, deep-learning, artificial-intelligence, large-language-model, py-langchain
1,728,891,673
se_79083740
stackoverflow
ARTIFICIAL_INTELLIGENCE
Has anyone used langchain with openai recently? I am getting lots of version incompatible errors when trying install and run?
Has anyone used langchain with openai recently? I am getting lots of version incompatible errors when trying install and run? I am trying to run the below code which i saw from a tutorial. I am trying to run openai api and generate some blog titles. from langchain.prompts.chat import ChatPromptTemplate from langchain_...
https://stackoverflow.com/questions/79083740/has-anyone-used-langchain-with-openai-recently-i-am-getting-lots-of-version-inc
python, openai-api, large-language-model, py-langchain
1,728,840,200
se_77217451
stackoverflow
ARTIFICIAL_INTELLIGENCE
How use past_key_values in pytorch for caching
How use past_key_values in pytorch for caching why using past_key_values of "hello, my dog is" plus the input id of "cute" doesn't output the same as using "hello, my dog is cute" In my understanding the past_key_values are past calculations, and in theory they can be used as a kind of cache, but I don't understand ho...
https://stackoverflow.com/questions/77217451/how-use-past-key-values-in-pytorch-for-caching
python, pytorch, huggingface-transformers, large-language-model, gpt-2
1,696,268,300
se_79075644
stackoverflow
ARTIFICIAL_INTELLIGENCE
My llama2 model is talking to itself asking question and answering it to them using Conversational retrieval chain
My llama2 model is talking to itself asking question and answering it to them using Conversational retrieval chain I was implementing RAG on a document with using the LLama2 model but my model is asking questions to itself and answering it to them. llm = LlamaCpp(model_path=model_path, temperature=0, max_token...
https://stackoverflow.com/questions/79075644/my-llama2-model-is-talking-to-itself-asking-question-and-answering-it-to-them-us
python, nlp, large-language-model, rag, llama-cpp-python
1,728,583,426
se_76706171
stackoverflow
ARTIFICIAL_INTELLIGENCE
Langchain agent does not always use the tool correctly
Langchain agent does not always use the tool correctly Sometimes the Langchain Agent entering the custom tool with the input: "Invalid or incomplete response" Even if the LLM seems to use the tool correctly. Any idea why and how to fix that ? I would point out that sometimes everything works as expected. My tool: @too...
https://stackoverflow.com/questions/76706171/langchain-agent-does-not-always-use-the-tool-correctly
python, artificial-intelligence, langchain, py-langchain, large-language-model
1,689,609,052
se_79073466
stackoverflow
ARTIFICIAL_INTELLIGENCE
LLM Model not returning desire result after fine-tune with CSV Dataset
LLM Model not returning desire result after fine-tune with CSV Dataset Im trying to fine-tune/train LLama3.2 with local csv. these are step that ive done already : Importing the required library : import pandas as pd from transformers import AutoTokenizer, AutoModelForCausalLM import torch from torch.utils.data import...
https://stackoverflow.com/questions/79073466/llm-model-not-returning-desire-result-after-fine-tune-with-csv-dataset
pytorch, transform, large-language-model
1,728,549,626
se_78964842
stackoverflow
ARTIFICIAL_INTELLIGENCE
Host a Model with vllm for RAG
Host a Model with vllm for RAG I am struggling with an issue here trying to host an LLM using vLLM for performing RAG. When I start the vLLM server with minimal arguments, for example vllm serve --model NousResearch/Hermes-2-Pro-Llama-3-8B, the server starts, but when I send a request, I get an error saying that I sho...
https://stackoverflow.com/questions/78964842/host-a-model-with-vllm-for-rag
chatbot, langchain, large-language-model, rag, vllm
1,725,874,784
se_79029041
stackoverflow
ARTIFICIAL_INTELLIGENCE
Splitting a HTML document for an LLM with limited token size
Splitting a HTML document for an LLM with limited token size Scenario: I am trying to make modifications to a HTML file based on some user/dev feedback. I want to introduce a layer in my CI/CD pipeline that makes modifications to the html build of my project before it is deployed. Feedback can be something like "make ...
https://stackoverflow.com/questions/79029041/splitting-a-html-document-for-an-llm-with-limited-token-size
python, html, algorithm, large-language-model, gpt-4
1,727,382,797
se_77571997
stackoverflow
ARTIFICIAL_INTELLIGENCE
Langchain4j with downloaded LLM
Langchain4j with downloaded LLM I am exploring Langchain4j. I want to use it to interact with the downloaded model locally. I have downloaded stable-diffusion model from Huggingface using this command: git lfs clone https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0 How can I use Langchain4j(with stable-...
https://stackoverflow.com/questions/77571997/langchain4j-with-downloaded-llm
java, langchain, large-language-model, stable-diffusion
1,701,267,856
se_79068235
stackoverflow
ARTIFICIAL_INTELLIGENCE
To use hugging face model, what are shards (same as checkpoint)? Do I need all?
To use hugging face model, what are shards (same as checkpoint)? Do I need all? I want to use this for a zero-shot QA model: https://huggingface.co/nvidia/NVLM-D-72B/tree/main When I download it using the following, it starts downloading 46 shards. There are 46 bin files in the link above. Do I need them all? What els...
https://stackoverflow.com/questions/79068235/to-use-hugging-face-model-what-are-shards-same-as-checkpoint-do-i-need-all
nvidia, huggingface-transformers, large-language-model, huggingface
1,728,438,208