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_78015787
stackoverflow
ARTIFICIAL_INTELLIGENCE
AttributeError: 'Collection' object has no attribute '__pydantic_private__'. Did you mean: '__pydantic_complete__'?
AttributeError: 'Collection' object has no attribute '__pydantic_private__'. Did you mean: '__pydantic_complete__'? I am trying to create pdf chat using open source LLM. I get the below error when I run ingest.py (my_venv) PS C:\GithubRepository\Chat-with-PDF-Chatbot> python ingest.py ...
https://stackoverflow.com/questions/78015787/attributeerror-collection-object-has-no-attribute-pydantic-private-did
python, pydantic, large-language-model, chromadb, pydantic-settings
1,708,260,386
se_78885166
stackoverflow
ARTIFICIAL_INTELLIGENCE
LangChain failure with long input texts
LangChain failure with long input texts I am working with LangChain's LLMChain to process large documents. I see quite some problems when the input text exceeds the token limit of the language model. For long input text, it has significant slowdowns and can even sometimes fail due to overflow of tokens. This is the sa...
https://stackoverflow.com/questions/78885166/langchain-failure-with-long-input-texts
python, openai-api, langchain, large-language-model, chatgpt-api
1,723,999,560
se_78886747
stackoverflow
ARTIFICIAL_INTELLIGENCE
Langchain SQLDatabaseChain error due to SQL formatting
Langchain SQLDatabaseChain error due to SQL formatting import os from dotenv import load_dotenv load_dotenv() import google.generativeai as genai from langchain_google_genai import GoogleGenerativeAI # Ensure your GOOGLE_API_KEY is set in the .env file api_key = os.getenv("GEMINI_API_KEY") # Use GoogleGenerativeAI...
https://stackoverflow.com/questions/78886747/langchain-sqldatabasechain-error-due-to-sql-formatting
python, google-bigquery, chatbot, langchain, large-language-model
1,724,052,304
se_78883642
stackoverflow
ARTIFICIAL_INTELLIGENCE
Llama3-8b-instruct returns value of "None" when using with_structure_output whereas Llama3-405b succeeds
Llama3-8b-instruct returns value of "None" when using with_structure_output whereas Llama3-405b succeeds Comparing two of the Llama3 models, 8b and 405b. 8b I can load locally with docker. 405b is cloud-based. This should present no issues other than the model's capacity to answer questions. I think I hit t...
https://stackoverflow.com/questions/78883642/llama3-8b-instruct-returns-value-of-none-when-using-with-structure-output-wher
langchain, large-language-model, llama
1,723,949,243
se_78760514
stackoverflow
ARTIFICIAL_INTELLIGENCE
Preparing text data for raft implementation
Preparing text data for raft implementation I want to use Raft Retrieval Augmented Fine Tuning to build a smart chatbot. My data consists of scraped text from multiple websites. Should I transform it all to QAD format? If so, is there a way to do it automatically? considering that my dataset is very large and doing it...
https://stackoverflow.com/questions/78760514/preparing-text-data-for-raft-implementation
web-scraping, large-language-model, rag
1,721,231,818
se_77909589
stackoverflow
ARTIFICIAL_INTELLIGENCE
ValueError: You cannot perform fine-tuning on purely quantized models
ValueError: You cannot perform fine-tuning on purely quantized models When trying to finetune a falcon 7b model on some training data of mine I am getting the following error: ValueError: You cannot perform fine-tuning on purely quantized models. Please attach trainable adapters on top of the quantized model to correc...
https://stackoverflow.com/questions/77909589/valueerror-you-cannot-perform-fine-tuning-on-purely-quantized-models
large-language-model, huggingface
1,706,651,072
se_78392959
stackoverflow
ARTIFICIAL_INTELLIGENCE
Where does anythingLLM desktop save its embedding database files
Where does anythingLLM desktop save its embedding database files I have installed anythingLLM desktop (app) on my Windows 11 (Home) platform. I have used ollama (installed in WSL2 Ubuntu) to run LLMs. anythingLLM is running fine. I am unable to find out where its vector database (lancedb) files are stored. And also wh...
https://stackoverflow.com/questions/78392959/where-does-anythingllm-desktop-save-its-embedding-database-files
large-language-model, ollama
1,714,165,267
se_78875558
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to get the full reasoning history of vertexai LangchainAgent
How to get the full reasoning history of vertexai LangchainAgent How I can see the full reasoning history of a vertexai.preview.reasoning_engines.LangchainAgent after calling the query method - I have tried setting return_intermediate_steps to True in model_kwargs and agent_executor_kwargs, but this only prints the to...
https://stackoverflow.com/questions/78875558/how-to-get-the-full-reasoning-history-of-vertexai-langchainagent
python, large-language-model, agent, google-cloud-vertex-ai
1,723,731,970
se_78443363
stackoverflow
ARTIFICIAL_INTELLIGENCE
Error while loading MISTRAL LLM for fine-tune. Qlora doesn't work but full works
Error while loading MISTRAL LLM for fine-tune. Qlora doesn't work but full works if I try to load the model in this way : bnb_config = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_use_double_quant=True) model = AutoModelForCausalLM.from_pretrained( "mistralai/Mistr...
https://stackoverflow.com/questions/78443363/error-while-loading-mistral-llm-for-fine-tune-qlora-doesnt-work-but-full-works
deep-learning, large-language-model, fine-tuning, mistral-7b
1,715,093,452
se_78873329
stackoverflow
ARTIFICIAL_INTELLIGENCE
Understanding statistical significance
Understanding statistical significance I have 16 birds (191978,191984, 191977, 191980, 191986, 201446, 191983, 201447, 211598, 211590, 211595, 191981, 211591, 201441, 201445, 211592). There are 6 males and 10 females. The dataset is called 'Gbirds_sex' I have the number of times they revisit their release site (visitI...
https://stackoverflow.com/questions/78873329/understanding-statistical-significance
statistics, glm, large-language-model, glmmtmb
1,723,683,287
se_78873680
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to create a function call tool to analyse CSV in LLM Long-chain with all columns definition predefined
How to create a function call tool to analyse CSV in LLM Long-chain with all columns definition predefined Context I would like to create an GPT Agent. This Agent should be able to fetch data from 3 predefined CSV files. Hence I would like to create 3 function tools for each CSV file. Expectation AI Agent should under...
https://stackoverflow.com/questions/78873680/how-to-create-a-function-call-tool-to-analyse-csv-in-llm-long-chain-with-all-col
python, openai-api, langchain, large-language-model, gpt-4
1,723,697,711
se_78869859
stackoverflow
ARTIFICIAL_INTELLIGENCE
ModuleNotFoundError: No module named 'transformers.models.phi3'
ModuleNotFoundError: No module named 'transformers.models.phi3' When I try to run a LLM named ChatGLM3 in Aliyun, I run a python script to run a demo,but it comes out an error like this.enter image description here How to solve it ?the LLM‘s github link is text,another py file named streamlit run web_demo_stre...
https://stackoverflow.com/questions/78869859/modulenotfounderror-no-module-named-transformers-models-phi3
python, large-language-model
1,723,623,903
se_78870698
stackoverflow
ARTIFICIAL_INTELLIGENCE
Is it necessary for torch_dtype when loading a model and the precision for trainable weights to be different? If so, why?
Is it necessary for torch_dtype when loading a model and the precision for trainable weights to be different? If so, why? According to this comment in the huggingface/peft package, if a model is loaded in fp16, the trainable weights must be cast to fp32. From this comment, I understand that generally, the torch_dtype ...
https://stackoverflow.com/questions/78870698/is-it-necessary-for-torch-dtype-when-loading-a-model-and-the-precision-for-train
python, pytorch, nlp, huggingface-transformers, large-language-model
1,723,635,568
se_78861856
stackoverflow
ARTIFICIAL_INTELLIGENCE
How do I solve an AttributeError: 'str' object has no attribute 'page_content' error?
How do I solve an AttributeError: 'str' object has no attribute 'page_content' error? I have a Json file which has Dictionary type structure. I want to get chunks of its information followed by create embeddings. I am getting this error while I create Embeddings: from langchain_community.vectorstores i...
https://stackoverflow.com/questions/78861856/how-do-i-solve-an-attributeerror-str-object-has-no-attribute-page-content-e
json, python-3.x, langchain, large-language-model, ollama
1,723,468,068
se_78863385
stackoverflow
ARTIFICIAL_INTELLIGENCE
Recency-aware finetuning for question answering
Recency-aware finetuning for question answering I am looking to fine-tune LLaMA 3 for a question-answering task using specific data that I have collected. Each question-answer pair in my dataset includes a timestamp (in the format MM/DD/YY) ranging from as far back as 2005 to as recent as 2024. While I intend to utili...
https://stackoverflow.com/questions/78863385/recency-aware-finetuning-for-question-answering
large-language-model, llama, fine-tuning, nlp-question-answering
1,723,492,509
se_78808829
stackoverflow
ARTIFICIAL_INTELLIGENCE
failed_generation with Groq LLM and llama index in Python
failed_generation with Groq LLM and llama index in Python My code is the following: from llama_parse import LlamaParse from llama_index.llms.groq import Groq from llama_parse.base import ResultType, Language from llama_index.core.node_parser import MarkdownElementNodeParser parser = LlamaParse( api_key="xxx", ...
https://stackoverflow.com/questions/78808829/failed-generation-with-groq-llm-and-llama-index-in-python
python, large-language-model, llama-index, groq
1,722,282,348
se_78519099
stackoverflow
ARTIFICIAL_INTELLIGENCE
Async Chain Invocation with Langchain Gets Stuck at await chain.invoke() in Python
Async Chain Invocation with Langchain Gets Stuck at await chain.invoke() in Python I am working on a project using the Langchain library to process and query information from a PDF document. My setup involves loading the PDF, splitting it into chunks, adding these chunks to a vector database, and then setting up a ret...
https://stackoverflow.com/questions/78519099/async-chain-invocation-with-langchain-gets-stuck-at-await-chain-invoke-in-pyth
python, langchain, large-language-model, py-langchain, ollama
1,716,397,884
se_76537855
stackoverflow
ARTIFICIAL_INTELLIGENCE
Finetuning Open LLMs
Finetuning Open LLMs I am a newbie trying to learn fine tuning. Started with falcon 7B instruct LLM as my base LLM and want to fine tune this with open assistant instruct dataset. I have 2080 Ti with 11G VRAM. So I am using 4 bit quantization and Lora. These are the experiments I did so far: 1> I trained with SFT trai...
https://stackoverflow.com/questions/76537855/finetuning-open-llms
huggingface, falcon, large-language-model
1,687,504,558
se_78248012
stackoverflow
ARTIFICIAL_INTELLIGENCE
Failure running Apple MLX lora.py on 13B llms
Failure running Apple MLX lora.py on 13B llms I am attempting to train my models on my own data. If I run the lora.py command using the 7b models from mistral or llama, it works fine. As soon as I upgrade to the larger models, I get an error File “/Users/conleysa/AI/MLX/mlx_venv/lib/python3.11/site-packages/mlx/nn/lay...
https://stackoverflow.com/questions/78248012/failure-running-apple-mlx-lora-py-on-13b-llms
large-language-model
1,711,803,443
se_78838421
stackoverflow
ARTIFICIAL_INTELLIGENCE
Ollama with RAG for local utilization to chat with pdf
Ollama with RAG for local utilization to chat with pdf I am trying to build ollama usage by using RAG for chatting with pdf on my local machine. I followed this GitHub repo: https://github.com/tonykipkemboi/ollama_pdf_rag/tree/main The issue is when I am running code, there is no error, but the code will stop at embed...
https://stackoverflow.com/questions/78838421/ollama-with-rag-for-local-utilization-to-chat-with-pdf
python, large-language-model, python-embedding, ollama, rag
1,722,938,523
se_78857426
stackoverflow
ARTIFICIAL_INTELLIGENCE
Error when using inputs_embeds with generate method
Error when using inputs_embeds with generate method I'm encountering a problem when trying to use inputs_embeds to pass the embedding to my model: ValueError: You passed `inputs_embeds` to `.generate()`, but the model class LlamaForCausalLM doesn't have its forwarding implemented. See the GPT2 implementation for an ex...
https://stackoverflow.com/questions/78857426/error-when-using-inputs-embeds-with-generate-method
nlp, huggingface-transformers, large-language-model, embedding, word-embedding
1,723,345,658
se_78091831
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to combine Parent Document Retriever with Self Query Retriever with Lang Chain framework
How to combine Parent Document Retriever with Self Query Retriever with Lang Chain framework I have implemented a Self Query retriever (https://python.langchain.com/docs/modules/data_connection/retrievers/self_query) for my RAG model, and it works fine. I can retrieve specific chunks of documents based on metadata inf...
https://stackoverflow.com/questions/78091831/how-to-combine-parent-document-retriever-with-self-query-retriever-with-lang-cha
python, large-language-model, py-langchain, retrieval-augmented-generation
1,709,365,569
se_78845956
stackoverflow
ARTIFICIAL_INTELLIGENCE
Use ajax to call php, to call python, and get the result
Use ajax to call php, to call python, and get the result I have built a website with a fairly complex structure and lots of javascript and php functions. I avoided jquery to make it lighter. I now want to add a python function that should return a value to it. Most people recommend Flask for this, but all the examples...
https://stackoverflow.com/questions/78845956/use-ajax-to-call-php-to-call-python-and-get-the-result
javascript, python, php, ajax, large-language-model
1,723,071,087
se_78852760
stackoverflow
ARTIFICIAL_INTELLIGENCE
Getting HTTP Status code 429 while hitting OpenAI LLM API
Getting HTTP Status code 429 while hitting OpenAI LLM API I am using Langchain 0.2 to create a conversation pipeline with OpenAI LLM. Following is the code that I have written: chat_llm = ChatOpenAI( model_name="gpt-4", api_key=config\["api_key"\], openai_api_base=platform_url, default_headers=llm_headers, ) history_...
https://stackoverflow.com/questions/78852760/getting-http-status-code-429-while-hitting-openai-llm-api
python, openai-api, langchain, large-language-model, py-langchain
1,723,206,397
se_78843382
stackoverflow
ARTIFICIAL_INTELLIGENCE
Handling greet type of questions without llm in RAG
Handling greet type of questions without llm in RAG I'm implementing a Retrieval-Augmented Generation (RAG) system for a chatbot that handles a variety of user queries. While RAG is primarily designed to provide informative responses by retrieving relevant documents and generating responses using a language model (LLM...
https://stackoverflow.com/questions/78843382/handling-greet-type-of-questions-without-llm-in-rag
machine-learning, artificial-intelligence, large-language-model
1,723,029,471
se_78844205
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to develop a Generalized RAG Pipeline for Text, Images, and Structured Data
How to develop a Generalized RAG Pipeline for Text, Images, and Structured Data I'm trying to find a general solution for RAG to solve problems involving both text, images, chart, tables,.., they are in many different formats such as .docx, .xlsx, .pdf. The requirement for the answer: Some answers are just images Som...
https://stackoverflow.com/questions/78844205/how-to-develop-a-generalized-rag-pipeline-for-text-images-and-structured-data
python, langchain, large-language-model, python-embedding, rag
1,723,040,568
se_77960745
stackoverflow
ARTIFICIAL_INTELLIGENCE
Error when attempting to add data source to Azure OpenAI api
Error when attempting to add data source to Azure OpenAI api My code is working for a call to Azure OpenAI when I don't have a datasource added. However, when I do add my datasource with the following parameters I get an error: response = client.chat.completions.create( messages = [ { "role": "...
https://stackoverflow.com/questions/77960745/error-when-attempting-to-add-data-source-to-azure-openai-api
azure-cognitive-services, large-language-model, azure-openai
1,707,386,514
se_78820055
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why is attn_mask in PyTorch' MultiheadAttention specified for each head separately?
Why is attn_mask in PyTorch' MultiheadAttention specified for each head separately? PyTorch MultiheadAttention allows to specify the attention mask, either as 2D or as 3D. The former will be broadcasted over all N batches the latter allows one to specify specific masks for each example in the batch. All seems to m...
https://stackoverflow.com/questions/78820055/why-is-attn-mask-in-pytorch-multiheadattention-specified-for-each-head-separate
python, pytorch, large-language-model, transformer-model, multihead-attention
1,722,503,243
se_77362103
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to Convert openai functions to PromptTemplate in langchain when using local llms?
How to Convert openai functions to PromptTemplate in langchain when using local llms? Is is possible to Convert openai functions to PromptTemplate in langchain when using local llms and return final output similar to openai api function format import langchain functions = [ { "name": "get_current_w...
https://stackoverflow.com/questions/77362103/how-to-convert-openai-functions-to-prompttemplate-in-langchain-when-using-local
python, openai-api, large-language-model, py-langchain
1,698,258,834
se_78840242
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to return used context to answer using Langchain in Python
How to return used context to answer using Langchain in Python I have built a RAG system like this: loader = PyPDFLoader(pdf_file_name) raw_documents = loader.load() text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200) documents = text_splitter.split_documents(raw_documents) print(docume...
https://stackoverflow.com/questions/78840242/how-to-return-used-context-to-answer-using-langchain-in-python
python, langchain, large-language-model
1,722,963,447
se_78838209
stackoverflow
ARTIFICIAL_INTELLIGENCE
Error When Using unstructured to Partition PDF Files
Error When Using unstructured to Partition PDF Files I'm trying to use the unstructured, unstructured[pdf] library in Python to partition a .pdf file, but I'm encountering an error that I can't seem to resolve. The pdf file contains text, table, image,... Here's a brief overview of what I'm doing: from unstructured.pa...
https://stackoverflow.com/questions/78838209/error-when-using-unstructured-to-partition-pdf-files
python, python-3.x, large-language-model, rag
1,722,935,646
se_78836094
stackoverflow
ARTIFICIAL_INTELLIGENCE
LangChain Chat History
LangChain Chat History I am struggling with passing context to conversational rag chain when using RunnableWithMessageHistory. I have the following query function: def query(query_text, prompt, session_id, metadata_context): # History retrieval test contextualize_q_prompt = ChatPromptTemplate.from_messages( [ ...
https://stackoverflow.com/questions/78836094/langchain-chat-history
python, langchain, large-language-model, rag
1,722,885,154
se_78681454
stackoverflow
ARTIFICIAL_INTELLIGENCE
why message content is alway empty when I create my own tool with retriever in langchain?
why message content is alway empty when I create my own tool with retriever in langchain? I create a simpler retriever based on docs, after I create a tool and I want to bind it in LLM object, but when I make a question it return empty content. This is the code: llm = ChatOpenAI(temperature=0, model="gpt-4o",api_key =...
https://stackoverflow.com/questions/78681454/why-message-content-is-alway-empty-when-i-create-my-own-tool-with-retriever-in-l
large-language-model, agent, py-langchain, langchain-agents
1,719,564,081
se_78826206
stackoverflow
ARTIFICIAL_INTELLIGENCE
NameError: name '_LanguageModel' is not defined
NameError: name '_LanguageModel' is not defined I am trying to initialize vertexai llm in langchain library. from langchain_community.llms.vertexai import VertexAI llm = VertexAI( max_output_tokens=1024, temperature=0.2, top_p=0.8, top_k=40, verbose=True, ) I g...
https://stackoverflow.com/questions/78826206/nameerror-name-languagemodel-is-not-defined
python, langchain, large-language-model, google-cloud-vertex-ai
1,722,612,251
se_78835174
stackoverflow
ARTIFICIAL_INTELLIGENCE
run a large language model (LLM) as a .so shared library on Android for Unity3D integration
run a large language model (LLM) as a .so shared library on Android for Unity3D integration I'm developing a Unity3D application for Android, and I need to integrate a large language model (LLM). From what I understand, I would need to compile the LLM as a .so shared library to use it on Android. Has anyone done this ...
https://stackoverflow.com/questions/78835174/run-a-large-language-model-llm-as-a-so-shared-library-on-android-for-unity3d
android, unity-game-engine, shared-libraries, large-language-model, unity3d-editor
1,722,871,379
se_78504124
stackoverflow
ARTIFICIAL_INTELLIGENCE
ModuleNotFoundError: No module named 'torch.distributed._functional_collectives'
ModuleNotFoundError: No module named &#39;torch.distributed._functional_collectives&#39; I'm trying to run databricks/dolly-v2-12b usage code in collab. When I try their code: %pip install "accelerate>=0.16.0,<1" "transformers[torch]>=4.28.1,<5" "torch>=1.13.1,<2" import torch import torch.distributed as dist #import ...
https://stackoverflow.com/questions/78504124/modulenotfounderror-no-module-named-torch-distributed-functional-collectives
python, large-language-model, databricks-dolly
1,716,159,214
se_78834171
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to do distributed batch inference using tensor parallelism with Ray?
How to do distributed batch inference using tensor parallelism with Ray? I want to perform offline batch inference with a model that is too large to fit into one GPU. I want to use tensor parallelism for this. Previously I have used vLLM for batch inference. However, now I have a custom model that does not fit into vL...
https://stackoverflow.com/questions/78834171/how-to-do-distributed-batch-inference-using-tensor-parallelism-with-ray
large-language-model, ray, vllm
1,722,856,727
se_78826381
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why Langchain HuggingFaceEmbeddings model dimension is not the same as stated on HuggingFace
Why Langchain HuggingFaceEmbeddings model dimension is not the same as stated on HuggingFace I was using langchain HuggingFaceEmbeddings model: dunzhang/stella_en_1.5B_v5. When I look at https://huggingface.co/spaces/mteb/leaderboard, I can see that the model is 8192. But when I do len(embed_model.embed_query("hey you...
https://stackoverflow.com/questions/78826381/why-langchain-huggingfaceembeddings-model-dimension-is-not-the-same-as-stated-on
python, langchain, large-language-model, huggingface
1,722,615,129
se_78662101
stackoverflow
ARTIFICIAL_INTELLIGENCE
Chroma DB using embedding values
Chroma DB using embedding values I tried creating a chromadb using embedding values but its not working. I have my own embedding model that I want to deploy on the server. So here if I pass text as list I am getting its embedded values as output in list. But how to create chromadb or faiss db from this embedded values...
https://stackoverflow.com/questions/78662101/chroma-db-using-embedding-values
langchain, large-language-model, huggingface, python-embedding, chromadb
1,719,228,018
se_78827379
stackoverflow
ARTIFICIAL_INTELLIGENCE
What is the max_tokens number I can put for OpenAI GPT generate function?
What is the max_tokens number I can put for OpenAI GPT generate function? I've tried to use 100_000, 20_000 but seems like only 10_000 is possible: from openai import OpenAI client = OpenAI() messages = {"role": "user", "content": "Hello"} completion = client.chat.completions.create( model="gpt-4o-mini", mes...
https://stackoverflow.com/questions/78827379/what-is-the-max-tokens-number-i-can-put-for-openai-gpt-generate-function
python, openai-api, large-language-model, gpt-4o-mini
1,722,636,570
se_78823788
stackoverflow
ARTIFICIAL_INTELLIGENCE
Ollama not saving anything in context
Ollama not saving anything in context I am messing around with ollama in C# coding, and managed to get it to give me output, and even interacting with my code, however, Using the example they provided, I am running into an issue where the LLM is not retaining the previous conversations, and i ended up with the sloppy ...
https://stackoverflow.com/questions/78823788/ollama-not-saving-anything-in-context
c#, console, large-language-model, llama, ollama
1,722,573,138
se_77089465
stackoverflow
ARTIFICIAL_INTELLIGENCE
Sagemaker and LangChain: ValueError when calling InvokeEndpoint operation for Llama 2 model
Sagemaker and LangChain: ValueError when calling InvokeEndpoint operation for Llama 2 model I am trying to deploy a Llama 2 model for text generation inference using Sagemaker and LangChain. I am writing code in Notebook instances and deploying SageMaker instances from the code. I followed the documentation from https...
https://stackoverflow.com/questions/77089465/sagemaker-and-langchain-valueerror-when-calling-invokeendpoint-operation-for-ll
json, amazon-sagemaker, langchain, large-language-model, llama
1,694,524,372
se_78824535
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to implement bind_tools function in custom chat model
How to implement bind_tools function in custom chat model I am trying to build a agent which uses a custom LLM (eg llama-3) and have tool calling capability. I have build my own CustomChatModel class which inherits from BaseChatModel class. I have implemented my own _generate() function. For the bind_tools() function ...
https://stackoverflow.com/questions/78824535/how-to-implement-bind-tools-function-in-custom-chat-model
python, artificial-intelligence, langchain, large-language-model, llama
1,722,588,004
se_78697403
stackoverflow
ARTIFICIAL_INTELLIGENCE
system Requirements for the DeepSeek-Coder-V2-Instruct
system Requirements for the DeepSeek-Coder-V2-Instruct I want to know the Windows system requirements of the below versions of DeepSeek Coder V2 (236 TB and 21B AP). https://github.com/deepseek-ai/DeepSeek-Coder-V2/tree/main. I am using the system with specifications mentioned below: Device Name: ### Full Device Name...
https://stackoverflow.com/questions/78697403/system-requirements-for-the-deepseek-coder-v2-instruct
python-3.x, operating-system, gpu, large-language-model, ollama
1,719,926,988
se_78823603
stackoverflow
ARTIFICIAL_INTELLIGENCE
OpenAI Connection Error when running Python Langchain on GCS
OpenAI Connection Error when running Python Langchain on GCS I've deployed a flask application to Google Cloud Services. When I run Langchain's similarity_search_with_relevance_scores on my document/database set, it throws a vaugue openai.APIConnectionError: Connection error. Which is strange because locally, it works...
https://stackoverflow.com/questions/78823603/openai-connection-error-when-running-python-langchain-on-gcs
python, langchain, large-language-model, py-langchain, chromadb
1,722,565,887
se_78821995
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to load vectors from stored chroma db?
How to load vectors from stored chroma db? I'm working on creating a RAG-based LLM. The system is working correctly, i.e., the vector embeddings are successfully created and stored in the respective directory. However, the issue i'm facing is loading back those vectors from the stored chroma db file. Following is my f...
https://stackoverflow.com/questions/78821995/how-to-load-vectors-from-stored-chroma-db
python, chatbot, large-language-model, llama, chromadb
1,722,528,862
se_77844073
stackoverflow
ARTIFICIAL_INTELLIGENCE
Can I not add metadata to documents loaded using Chroma.from_documents()
Can I not add metadata to documents loaded using Chroma.from_documents() I wanted to add additional metadata to the documents being embedded and loaded into Chroma. I'm unable to find a way to add metadata to documents loaded using Chroma.from_documents(documents, embeddings) For example, imagine I have a text file ha...
https://stackoverflow.com/questions/77844073/can-i-not-add-metadata-to-documents-loaded-using-chroma-from-documents
python-3.x, large-language-model, py-langchain, chromadb
1,705,644,982
se_78822037
stackoverflow
ARTIFICIAL_INTELLIGENCE
Guidance on Extracting Compliance Items from PDF documents by fine-tuning a LLM
Guidance on Extracting Compliance Items from PDF documents by fine-tuning a LLM Need some guidance on extracting large compliance items from raw PDF documents. I have csv with these compliance items and I want to fine-tune a LLM such that if it reads any new PDF documents it can firstly identify the compliance items a...
https://stackoverflow.com/questions/78822037/guidance-on-extracting-compliance-items-from-pdf-documents-by-fine-tuning-a-llm
nlp, large-language-model, text-extraction
1,722,529,399
se_78821544
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to implement bind_tools function for custom LLM in langchain
How to implement bind_tools function for custom LLM in langchain I am very new to langchain. I am trying to build a agent that uses a custom or local llm, and should have the tool calling ability and memory. I am using create_tool_calling_agent() from langchain docs But I am getting the error - Traceback (most recent ...
https://stackoverflow.com/questions/78821544/how-to-implement-bind-tools-function-for-custom-llm-in-langchain
python, langchain, large-language-model, llama, langchain-agents
1,722,523,107
se_78113510
stackoverflow
ARTIFICIAL_INTELLIGENCE
In langserve, how to pass a configurable param to a langchain LLM chain using curl?
In langserve, how to pass a configurable param to a langchain LLM chain using curl? I have a langchain LLM chain linked to a route of a FastAPI server. I used langserve add_route() method. As I have session_id passed as "configurable" param and everything works when I invoke the chain directly like: chain.invoke({"que...
https://stackoverflow.com/questions/78113510/in-langserve-how-to-pass-a-configurable-param-to-a-langchain-llm-chain-using-cu
curl, parameters, langchain, large-language-model, configurable
1,709,720,113
se_78808274
stackoverflow
ARTIFICIAL_INTELLIGENCE
Ollama llama 3.1 issue in mac with api call
Ollama llama 3.1 issue in mac with api call I have setup Ollama in Mac with OS 14.5 (2.4 GHz 8-Core Intel Core i9), running llama 3.1 with terminal and asking question work fine. But when using api call its taking more than a minute to get response. Can there be any workaround for this as I see people have face issue ...
https://stackoverflow.com/questions/78808274/ollama-llama-3-1-issue-in-mac-with-api-call
large-language-model, llama, ollama
1,722,272,310
se_78815544
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to correctly save a fine tuned model using apple MLX framework
How to correctly save a fine tuned model using apple MLX framework We're using MLX to fine tune a model fetched from hugging face. from transformers import AutoModel model = AutoModel.from_pretrained('deepseek-ai/deepseek-coder-6.7b-instruct') We fine tuned the model with command like python -m mlx_lm.lora --config l...
https://stackoverflow.com/questions/78815544/how-to-correctly-save-a-fine-tuned-model-using-apple-mlx-framework
python, machine-learning, deep-learning, large-language-model
1,722,418,534
se_78812873
stackoverflow
ARTIFICIAL_INTELLIGENCE
Inconsistent Sum of Log Probabilities in PyTorch Causal Language Model
Inconsistent Sum of Log Probabilities in PyTorch Causal Language Model I'm working on a project using the transformers library from Hugging Face and PyTorch to compute log probabilities from a causal language model. I have two inputs: a single sentence and a batch of two sentences. However, I'm encountering an issue w...
https://stackoverflow.com/questions/78812873/inconsistent-sum-of-log-probabilities-in-pytorch-causal-language-model
huggingface-transformers, large-language-model, huggingface-tokenizers
1,722,357,975
se_78800797
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to view the final prompt in a MultiQueryRetriever pipeline using LangChain?
How to view the final prompt in a MultiQueryRetriever pipeline using LangChain? I am currently working on a project using the LangChain library where I want to retrieve relevant documents from a vector database and then generate answers based on these documents using the Ollama LLM. Below is my current implementation:...
https://stackoverflow.com/questions/78800797/how-to-view-the-final-prompt-in-a-multiqueryretriever-pipeline-using-langchain
python, langchain, large-language-model, ollama
1,722,065,284
se_76476765
stackoverflow
ARTIFICIAL_INTELLIGENCE
Training LLM to perform text classification
Training LLM to perform text classification I am trying to perform text classification using GPTNeo, using the tweet_eval dataset from huggingface. I am following this example https://huggingface.co/docs/transformers/tasks/sequence_classification, but there is some error. I am a beginner at LLMs and it will be very he...
https://stackoverflow.com/questions/76476765/training-llm-to-perform-text-classification
nlp, huggingface, large-language-model
1,686,769,102
se_78813152
stackoverflow
ARTIFICIAL_INTELLIGENCE
Ask multiple queries in parallel with Langchain Python
Ask multiple queries in parallel with Langchain Python I have managed to ask one query using langchain like this: template = """Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. Answer questions using the i...
https://stackoverflow.com/questions/78813152/ask-multiple-queries-in-parallel-with-langchain-python
python, large-language-model, py-langchain
1,722,363,097
se_78763914
stackoverflow
ARTIFICIAL_INTELLIGENCE
&#39;LlamaForCausalLM&#39; object has no attribute &#39;max_seq_length&#39;
&#39;LlamaForCausalLM&#39; object has no attribute &#39;max_seq_length&#39; I'm fine-tuning llama3 using unsloth , I trained my model and saved it successfully but when I tried loading using AutoPeftModelForCausalLM.from_pretrained ,then I used TextStreamer from transformer library for streaming the generated text , ...
https://stackoverflow.com/questions/78763914/llamaforcausallm-object-has-no-attribute-max-seq-length
python, large-language-model, llama, fine-tuning, llama3
1,721,299,632
se_78809281
stackoverflow
ARTIFICIAL_INTELLIGENCE
ImportError: cannot import name &#39;pre_init&#39; from &#39;langchain_core.utils&#39;
ImportError: cannot import name &#39;pre_init&#39; from &#39;langchain_core.utils&#39; When I want to install langchain libraries from requirements.txt I'm getting ImportError: cannot import name 'pre_init' from 'langchain_core.utils' I've tried to install libraries from terminal using these commands : pip install g...
https://stackoverflow.com/questions/78809281/importerror-cannot-import-name-pre-init-from-langchain-core-utils
python, pip, nlp, langchain, large-language-model
1,722,293,953
se_78598478
stackoverflow
ARTIFICIAL_INTELLIGENCE
Can&#39;t install causal-conv1d on Mac M1 - packaging module not found?
Can&#39;t install causal-conv1d on Mac M1 - packaging module not found? I'm installing oython package causal-conv1d on Mac Ventura, M1 Silicon and I am getting an error about packaging module not found. pip install causal-conv1d==1.1.1 # or any other version 1.2.1 etc The resulting error message is: kages/setup...
https://stackoverflow.com/questions/78598478/cant-install-causal-conv1d-on-mac-m1-packaging-module-not-found
python, large-language-model, state-space, mamba-ssm
1,717,933,426
se_78723306
stackoverflow
ARTIFICIAL_INTELLIGENCE
OpenWebUI + Pipelines (w/ langchain hopefully)
OpenWebUI + Pipelines (w/ langchain hopefully) I'm currently at the last step of https://github.com/open-webui/pipelines, and I tried to start the server, but it says the image below as my error. I'm not sure if the server is already running nor how to run a pipeline (like one of the examples) to test. Any advice woul...
https://stackoverflow.com/questions/78723306/openwebui-pipelines-w-langchain-hopefully
python, localhost, artificial-intelligence, langchain, large-language-model
1,720,486,997
se_78558492
stackoverflow
ARTIFICIAL_INTELLIGENCE
Unable to Load Phi3 Model in open-webui through WSL and Docker
Unable to Load Phi3 Model in open-webui through WSL and Docker I want to run the phi3 model locally on my laptop using WSL, Ollama, Docker, and Open-webui. Here are the steps I have followed: Installed WSL. Installed Ollama. Pulled the phi3 model using Ollama. Installed Docker. Installed Open-webui. I can chat with th...
https://stackoverflow.com/questions/78558492/unable-to-load-phi3-model-in-open-webui-through-wsl-and-docker
localhost, windows-subsystem-for-linux, large-language-model, webui, ollama
1,717,138,068
se_78734751
stackoverflow
ARTIFICIAL_INTELLIGENCE
How do I persist FAISS indexes?
How do I persist FAISS indexes? In the langchain wiki of FAISS, https://python.langchain.com/v0.2/docs/integrations/vectorstores/faiss/, it only talks about saving indexes to files. db.save_local("faiss_index") new_db = FAISS.load_local("faiss_index", embeddings) docs = new_db.similarity_search(query) How can I sav...
https://stackoverflow.com/questions/78734751/how-do-i-persist-faiss-indexes
python, vectorization, langchain, large-language-model, faiss
1,720,690,790
se_76300474
stackoverflow
ARTIFICIAL_INTELLIGENCE
mT5 Question/Answering fine tuning is generating empty sentences during inference
mT5 Question/Answering fine tuning is generating empty sentences during inference mT5-small Question Answering training is converging to high accuracy, high validation accuracy, near-zero low loss; however, when testing the model on trained questions, I am always receiving empty answers. Experiment Language: Arabic D...
https://stackoverflow.com/questions/76300474/mt5-question-answering-fine-tuning-is-generating-empty-sentences-during-inferenc
deep-learning, nlp-question-answering, fine-tuning, large-language-model
1,684,680,564
se_78639204
stackoverflow
ARTIFICIAL_INTELLIGENCE
SQLite query to chunk group_concat into groups that maximize a length constraint?
SQLite query to chunk group_concat into groups that maximize a length constraint? I have data in a SQLite table that I'd like to process in "chunks" that include concatenated fields of multiple rows up to an overall limit of 10,000 chars per chunk. I can run queries multiple times and write temp tables, if it helps. B...
https://stackoverflow.com/questions/78639204/sqlite-query-to-chunk-group-concat-into-groups-that-maximize-a-length-constraint
python, sqlite, large-language-model, group-concat
1,718,737,479
se_78788707
stackoverflow
ARTIFICIAL_INTELLIGENCE
AzureChatOpenAI only uses one tool at a time
AzureChatOpenAI only uses one tool at a time LangChain with AzureChatOpenAI is only ever calling one tool at a time. When prompting the model to multiply and add two sets of numbers, I expect two tool calls, however only one tool is called, without an obvious pattern which of the tools is called. I'm following this ex...
https://stackoverflow.com/questions/78788707/azurechatopenai-only-uses-one-tool-at-a-time
python, openai-api, langchain, large-language-model, python-3.12
1,721,828,317
se_77453943
stackoverflow
ARTIFICIAL_INTELLIGENCE
Local LLM as argument to initialize_agent function in langchain.agents
Local LLM as argument to initialize_agent function in langchain.agents How to correctly load a local model LLM and use it in the initialize_agent function of the langchain library? I have a LLM google/flan-t5-large (downloaded from HuggingFaces) stored in my computer that would like to load and use as the reasoning en...
https://stackoverflow.com/questions/77453943/local-llm-as-argument-to-initialize-agent-function-in-langchain-agents
langchain, large-language-model, py-langchain
1,699,539,965
se_77867015
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to prompt engineer LLM using LangChain to give &quot;unable to answer question&quot; when asked a question
How to prompt engineer LLM using LangChain to give &quot;unable to answer question&quot; when asked a question I am currently using LangChain and OpenAI to build a Natural Language to SQL model. The issue I am having is that I want the model to return "I don't know" or "Please provide more context" when answering a qu...
https://stackoverflow.com/questions/77867015/how-to-prompt-engineer-llm-using-langchain-to-give-unable-to-answer-question-w
prompt, langchain, large-language-model
1,706,019,947
se_78788062
stackoverflow
ARTIFICIAL_INTELLIGENCE
Optimal hyperparameters for fine tuning LLM
Optimal hyperparameters for fine tuning LLM could I ask you for help? I am doing fine tuning of LLM model Llama3 8b (with LoRA) for text classification. I am using Trainer from Huggingface. I am looking for the optimal learning_rate and per_device_train_batch_size. I am using AdamW_torch op...
https://stackoverflow.com/questions/78788062/optimal-hyperparameters-for-fine-tuning-llm
large-language-model, hyperparameters, fine-tuning, batchsize, learning-rate
1,721,820,716
se_77630319
stackoverflow
ARTIFICIAL_INTELLIGENCE
safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge
safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge When fine-tuning a Large Language model (Qwen), there is no .bin ending model files but only .safetensors. The following error occurs when importing this pre-trained model. The specific code and error information are as follows. code: d...
https://stackoverflow.com/questions/77630319/safetensors-rust-safetensorerror-error-while-deserializing-header-headertoolar
python, large-language-model, peft
1,702,102,068
se_78787053
stackoverflow
ARTIFICIAL_INTELLIGENCE
Where should I store my model if I want it loaded while running my application on Magic Leap?
Where should I store my model if I want it loaded while running my application on Magic Leap? I need my GGML model loaded when I open my app. But I used params.model = "files\\gpt-2-117M"; std::ifstream file(params.model); if (!file.good()) { return "wrong"; } It always returns "wrong", which means the fi...
https://stackoverflow.com/questions/78787053/where-should-i-store-my-model-if-i-want-it-loaded-while-running-my-application-o
android, path, large-language-model, magic-leap
1,721,808,185
se_78786346
stackoverflow
ARTIFICIAL_INTELLIGENCE
Is it possible to train large models on multiple TPUs/GPUs on Google Colab?
Is it possible to train large models on multiple TPUs/GPUs on Google Colab? I am working on training a (small-scale) large language model and would like to parallelize the training on Google Colab. Specifically, I want to know if it's possible to utilize multiple TPUs or GPUs to speed up the training and handle large ...
https://stackoverflow.com/questions/78786346/is-it-possible-to-train-large-models-on-multiple-tpus-gpus-on-google-colab
gpu, large-language-model, gnu-parallel, tpu
1,721,794,022
se_77512794
stackoverflow
ARTIFICIAL_INTELLIGENCE
Does Positional Interpolation Change Llama&#39;s Architecture?
Does Positional Interpolation Change Llama&#39;s Architecture? I'm currently exploring Meta's positional interpolation method, which aims to increase with minimal effort the context size of their large language model. This method extends the context length from n x n into n′ x n′. It achieves this by interpolating new...
https://stackoverflow.com/questions/77512794/does-positional-interpolation-change-llamas-architecture
large-language-model, llama
1,700,434,142
se_78784562
stackoverflow
ARTIFICIAL_INTELLIGENCE
Script for streaming Mistral-7B LLM output only streams on server side. Client gets full output
Script for streaming Mistral-7B LLM output only streams on server side. Client gets full output I designed a remote server - client pipeline, which is supposed to load the model on the server and stream the output of the model. At the moment, the output is correctly streamed, but only inside the server, meaning that t...
https://stackoverflow.com/questions/78784562/script-for-streaming-mistral-7b-llm-output-only-streams-on-server-side-client-g
deep-learning, pytorch, large-language-model, mistral-7b
1,721,751,414
se_78748344
stackoverflow
ARTIFICIAL_INTELLIGENCE
GPT-2 model from hugging face always generate same result
GPT-2 model from hugging face always generate same result Why were all the results I got from the GPT-2 model the same no matter what I fed into it? The following are my operating details. First I download the needed files from the official website. These files included config.json, merges.txt, pytorch_model.bin, toke...
https://stackoverflow.com/questions/78748344/gpt-2-model-from-hugging-face-always-generate-same-result
deep-learning, pytorch, huggingface-transformers, large-language-model, gpt-2
1,721,025,119
se_77406208
stackoverflow
ARTIFICIAL_INTELLIGENCE
CUDA out of memory error during PEFT LoRA fine tuning
CUDA out of memory error during PEFT LoRA fine tuning 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 Python 3 code below. I'm running this on ubuntu server 18.04LTS with an invidia gpu that has 8GB of ram...
https://stackoverflow.com/questions/77406208/cuda-out-of-memory-error-during-peft-lora-fine-tuning
pytorch, large-language-model, peft
1,698,882,493
se_78095157
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why we use return_tensors = &quot;pt&quot; during tokenization?
Why we use return_tensors = &quot;pt&quot; during tokenization? So I am doing tokenization of my dataset, and created one function, max_length = 1026 def generate_and_tokenize_prompt(prompt): result = tokenizer( prompt, return_tensors="pt", truncation=True, max_length=max_length, ...
https://stackoverflow.com/questions/78095157/why-we-use-return-tensors-pt-during-tokenization
large-language-model, huggingface, huggingface-tokenizers
1,709,441,618
se_78688150
stackoverflow
ARTIFICIAL_INTELLIGENCE
I got a error while pip install flash-attn throwing error
I got a error while pip install flash-attn throwing error enter code hereI am currently trying to install 'microsoft/Florence-2-large' model and following the documentation provided here on its github page. When running pip install flash-attn --no-build-isolation I am thrown this error: Collecting flash_attn Using...
https://stackoverflow.com/questions/78688150/i-got-a-error-while-pip-install-flash-attn-throwing-error
python, windows, flash, model, large-language-model
1,719,739,808
se_77737111
stackoverflow
ARTIFICIAL_INTELLIGENCE
Errors while running DeepMind&#39;s publicly available code regarding their recent mathematical breakthrough
Errors while running DeepMind&#39;s publicly available code regarding their recent mathematical breakthrough I am trying to re-produce DeepMind's recent result, in which they found new examples of mathematical objects using LLM's. I am trying to execute their publicly available code on GitHub. However, despite running...
https://stackoverflow.com/questions/77737111/errors-while-running-deepminds-publicly-available-code-regarding-their-recent-m
python, module, large-language-model
1,703,963,067
se_78773889
stackoverflow
ARTIFICIAL_INTELLIGENCE
TRL SFTTrainer clarification on truncation
TRL SFTTrainer clarification on truncation I am currently finetuning LLama models using SFTTrainer in huggingface. However, I came up with a question, I can not answer through the documentations (atleast, it is a bit ambigious). My dataset contains samples from 20 tokens to 5k tokens. Currently I am using a max_seq_le...
https://stackoverflow.com/questions/78773889/trl-sfttrainer-clarification-on-truncation
python, large-language-model, huggingface, llama
1,721,508,383
se_78750364
stackoverflow
ARTIFICIAL_INTELLIGENCE
Saving Fine-tune Falcon HuggingFace LLM Model
Saving Fine-tune Falcon HuggingFace LLM Model I'm trying to save my model so it won't need to re-download the base model every time I want to use it but nothing seems to work for me, I would love your help with it. The following parameters are used for the training: hf_model_name = "tiiuae/falcon-7b-instruct" dir_path...
https://stackoverflow.com/questions/78750364/saving-fine-tune-falcon-huggingface-llm-model
python, huggingface-transformers, large-language-model, inference, pre-trained-model
1,721,053,236
se_77815754
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to run LangChain Ollama with ngrok url?
How to run LangChain Ollama with ngrok url? I ran a script to get the ngrok url: import asyncio # Set LD_LIBRARY_PATH so the system NVIDIA library os.environ.update({'LD_LIBRARY_PATH': '/usr/lib64-nvidia'}) async def run_process(cmd): print('>>> starting', *cmd) p = await asyncio.subprocess.create_subprocess_ex...
https://stackoverflow.com/questions/77815754/how-to-run-langchain-ollama-with-ngrok-url
python, ngrok, large-language-model, ollama
1,705,248,710
se_78751682
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to get multimodal embeddings from CLIP model?
How to get multimodal embeddings from CLIP model? I'm hoping to use CLIP to get a single embedding for rows of multimodal (image and text) data. Say I have the following model: from PIL import Image import torch from transformers import CLIPProcessor, CLIPModel import torchvision.transforms as transforms model = CLIP...
https://stackoverflow.com/questions/78751682/how-to-get-multimodal-embeddings-from-clip-model
machine-learning, conv-neural-network, openai-api, large-language-model, word-embedding
1,721,073,198
se_78768979
stackoverflow
ARTIFICIAL_INTELLIGENCE
RuntimeError: probability tensor contains either `inf`, `nan` or element &lt; 0
RuntimeError: probability tensor contains either `inf`, `nan` or element &lt; 0 am trying to output the response of the llama2 model that i installed locally, but when i try to execute the following lines: output = model.generate(**inputs, streamer=streamer, use_cache=True, max_new_tokens=float('inf')) 1-I tried model...
https://stackoverflow.com/questions/78768979/runtimeerror-probability-tensor-contains-either-inf-nan-or-element-0
large-language-model, llama, rag
1,721,386,550
se_78763439
stackoverflow
ARTIFICIAL_INTELLIGENCE
Error when tracing llm calls with Langsmith (Failed to get info from https://eu.smith.langchain.com) (Failed to batch ingest runs: LangSmithError))
Error when tracing llm calls with Langsmith (Failed to get info from https://eu.smith.langchain.com) (Failed to batch ingest runs: LangSmithError)) I have an issue with lansgmith setup. I tried to search on the web for this issue, but could not find a solution. I follow these steps: Created a new fresh environment: ...
https://stackoverflow.com/questions/78763439/error-when-tracing-llm-calls-with-langsmith-failed-to-get-info-from-https-eu
openai-api, langchain, large-language-model, langsmith
1,721,294,001
se_78758291
stackoverflow
ARTIFICIAL_INTELLIGENCE
AnswerRelevancyMetric not showing results on LLM evaluation
AnswerRelevancyMetric not showing results on LLM evaluation i've got this code : from langchain_openai import AzureChatOpenAI from deepeval.models.base_model import DeepEvalBaseLLM class AzureOpenAI(DeepEvalBaseLLM): def __init__( self, model ): self.model = model def load_model(s...
https://stackoverflow.com/questions/78758291/answerrelevancymetric-not-showing-results-on-llm-evaluation
metrics, large-language-model, azure-openai, gpt-3
1,721,203,162
se_77702325
stackoverflow
ARTIFICIAL_INTELLIGENCE
Persist VectorStoreIndex (LlamaIndex) locally
Persist VectorStoreIndex (LlamaIndex) locally I am trying to run this import logging import sys from llama_index import VectorStoreIndex, SimpleDirectoryReader, ServiceContext import torch from llama_index.llms import LlamaCPP from llama_index.llms.llama_utils import messages_to_prompt, completion_to_prompt from langc...
https://stackoverflow.com/questions/77702325/persist-vectorstoreindex-llamaindex-locally
large-language-model, llama-index, llamacpp
1,703,231,173
se_76254947
stackoverflow
ARTIFICIAL_INTELLIGENCE
OpenAi tokens consumed in generating response of a query from custom knowledge base
OpenAi tokens consumed in generating response of a query from custom knowledge base I am using OpenAI API to build a chatbot based on data feed by me, its consuming more tokens as predicted by words count from query & response,what is the reason? I provided the chatbot with file containing details about finals of fifa...
https://stackoverflow.com/questions/76254947/openai-tokens-consumed-in-generating-response-of-a-query-from-custom-knowledge-b
artificial-intelligence, openai-api, large-language-model
1,684,159,685
se_76772509
stackoverflow
ARTIFICIAL_INTELLIGENCE
Llama-2 7B-hf repeats context of question directly from input prompt, cuts off with newlines
Llama-2 7B-hf repeats context of question directly from input prompt, cuts off with newlines Context: I am trying to query Llama-2 7B, taken from HuggingFace (meta-llama/Llama-2-7b-hf). I give it a question and context (I would guess anywhere from 200-1000 tokens), and ask it to answer the question based on the contex...
https://stackoverflow.com/questions/76772509/llama-2-7b-hf-repeats-context-of-question-directly-from-input-prompt-cuts-off-w
python, artificial-intelligence, huggingface-transformers, large-language-model
1,690,382,805
se_78706130
stackoverflow
ARTIFICIAL_INTELLIGENCE
OpenAI API query for an input document
OpenAI API query for an input document I could build and chat with openAI model but I wish to upload a document and try to ask questions based on that doc. I check some discussions like this My code likes from langchain_community.document_loaders.csv_loader import CSVLoader from langchain_openai import AzureChatOpenAI...
https://stackoverflow.com/questions/78706130/openai-api-query-for-an-input-document
openai-api, large-language-model, azure-openai
1,720,084,166
se_78753293
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to improve response time of Phi-3-medium-128k serverless API?
How to improve response time of Phi-3-medium-128k serverless API? I have deployed the Phi-3-medium-128k model using Azure AI Studio (serverless deployment). I am using the v1/chat/completions API to get chat completions and I am streaming the response. The time to first token is quite high, ~15 secs for an average inp...
https://stackoverflow.com/questions/78753293/how-to-improve-response-time-of-phi-3-medium-128k-serverless-api
python, azure, large-language-model, azure-ai
1,721,116,413
se_78589104
stackoverflow
ARTIFICIAL_INTELLIGENCE
Why does with_structured_output ignore optional params in Pydantic models
Why does with_structured_output ignore optional params in Pydantic models I am experimenting with Langchain's ability to take a Pydantic model and return a structured JSON-like output from an LLM. I guess I don't understand how Optional is being interpreted. Example using the Pydantic model directly vs its JSON cousin...
https://stackoverflow.com/questions/78589104/why-does-with-structured-output-ignore-optional-params-in-pydantic-models
python, pydantic, langchain, large-language-model
1,717,708,726
se_77287311
stackoverflow
ARTIFICIAL_INTELLIGENCE
Exceeding LLM&#39;s maximum context length even using llama_index PromptHelper
Exceeding LLM&#39;s maximum context length even using llama_index PromptHelper I've been struggling with llama_index's PromptHelper and can't find a solution anywhere on the Internet. But first let me talk about my use case: I'm trying to use Azure OpenAI's GPT-3.5 model to ask the model to make a summary of comments ...
https://stackoverflow.com/questions/77287311/exceeding-llms-maximum-context-length-even-using-llama-index-prompthelper
prompt, langchain, large-language-model, llama-index
1,697,195,732
se_78738829
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to use Google Vertex AI fine tuned model via Node.js
How to use Google Vertex AI fine tuned model via Node.js I fine-tuned a model on Google Vertex AI. Before that, I was using regular models with this code(it works): public static async SendMessage(prompt) { const vertexAI = new VertexAI({project: GOOGLE_PROJECT_ID, location: 'us-central1', googleAuthOptions: {keyF...
https://stackoverflow.com/questions/78738829/how-to-use-google-vertex-ai-fine-tuned-model-via-node-js
node.js, google-cloud-platform, large-language-model, google-cloud-vertex-ai
1,720,764,642
se_77684999
stackoverflow
ARTIFICIAL_INTELLIGENCE
GooglePalm(). NotImplementedError: Need to determine which default deprecation schedule to use. within ?? minor releases
GooglePalm(). NotImplementedError: Need to determine which default deprecation schedule to use. within ?? minor releases this code was working fine before, and now it raise this error when calling GooglePalm with langchain. The error: ----> 8 llm = GooglePalm(). NotImplementedError: Need to determine which default dep...
https://stackoverflow.com/questions/77684999/googlepalm-notimplementederror-need-to-determine-which-default-deprecation-s
nlp, langchain, large-language-model, palm-pre
1,702,986,818
se_78725722
stackoverflow
ARTIFICIAL_INTELLIGENCE
Passing Additional Information in LangChain abatch Calls
Passing Additional Information in LangChain abatch Calls Given an abatch call for a LangChain chain, I need to pass additional information, beyond just the content, to the function so that this information is available in the callback, specifically in the on_chat_model_start method. Here is the code: from langchai...
https://stackoverflow.com/questions/78725722/passing-additional-information-in-langchain-abatch-calls
python, langchain, large-language-model
1,720,529,633
se_78738619
stackoverflow
ARTIFICIAL_INTELLIGENCE
Dockerized OpenSearch not returning any hits for queries
Dockerized OpenSearch not returning any hits for queries I recently tried to move the chatbot project that I am working on over to OpenSearch. At first, my search function was working, but after dockerizing OpenSearch, I've run into the issue where my queries are not returning any hits. I tried to manually push a test...
https://stackoverflow.com/questions/78738619/dockerized-opensearch-not-returning-any-hits-for-queries
python, large-language-model, opensearch
1,720,759,070
se_77953302
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to retrieve the generated SQL query from create_sql_agent of Langchain?
How to retrieve the generated SQL query from create_sql_agent of Langchain? I have used Langchain - create_sql_agent to generate SQL queries with a database and get the output result of the generated SQL query. Here is how my code looks like, it is working pretty well. agent = create_sql_agent( llm=llm, db=db,...
https://stackoverflow.com/questions/77953302/how-to-retrieve-the-generated-sql-query-from-create-sql-agent-of-langchain
python, sql, python-3.x, langchain, large-language-model
1,707,295,563
se_78688141
stackoverflow
ARTIFICIAL_INTELLIGENCE
How to choose dataset_text_field in SFTTrainer hugging face for my LLM model
How to choose dataset_text_field in SFTTrainer hugging face for my LLM model Note: Newbie to LLM's Background of my problem I am trying to train a LLM using LLama3 on stackoverflow c langauge dataset. LLm - meta-llama/Meta-Llama-3-8B Dataset - Mxode/StackOverflow-QA-C-Language-40k My dataset structure looks like so D...
https://stackoverflow.com/questions/78688141/how-to-choose-dataset-text-field-in-sfttrainer-hugging-face-for-my-llm-model
python, large-language-model, huggingface, huggingface-datasets
1,719,739,557
se_78733386
stackoverflow
ARTIFICIAL_INTELLIGENCE
Convert Quantization to Onnx
Convert Quantization to Onnx I am new and want to try converting models to Onnx format and I have the following issue. I have a model that has been quantized to 4-bit, and then I converted this model to Onnx. My quantized model has a weight size of 7GB, but when I run the conversion to Onnx, my resulting model.onnx_da...
https://stackoverflow.com/questions/78733386/convert-quantization-to-onnx
large-language-model, onnx, quantization
1,720,667,037
se_78621007
stackoverflow
ARTIFICIAL_INTELLIGENCE
Trouble importing DFFullProgram, DataFrame, and DataFrameRowsOnly from llama_index
Trouble importing DFFullProgram, DataFrame, and DataFrameRowsOnly from llama_index I have installed the llama_index library correctly and when attempting to import DFFullProgram, DataFrame,and DataFrameRowsOnly I recevie the following error. ImportError: cannot import name 'DFFullProgram' from 'llama_index.core.progr...
https://stackoverflow.com/questions/78621007/trouble-importing-dffullprogram-dataframe-and-dataframerowsonly-from-llama-ind
python, dataframe, large-language-model, llama-index
1,718,338,643