Questions tagged [llm]

A general tag for large language model (LLM)-related subjects. Please ALWAYS use the more specific tags if available (GPT variants, PaLM , LLaMa, BLOOM, Claude etc..)

A general tag for large language model (LLM)-related subjects. Please ALWAYS use the more specific tags if available (GPT variants, PaLM , LLaMa, BLOOM, Claude etc..)

A large language model is characterized by its large size. Their AI accellerator networks are able to process huge amounts of text data, usually scraped from the internet.

200 questions
1
vote
2 answers

Getting an error when trying to use ChromaDB

I am new to LangChain and I was trying to implement a simple Q & A system based on an example tutorial online. The code is as follows: from langchain.llms import LlamaCpp from langchain.llms import gpt4all from langchain.embeddings import…
adhok
  • 391
  • 2
  • 16
1
vote
0 answers

how to create a custom tool in create_pandas_dataframe_agent in langchain?

I'm trying to create a create_pandas_dataframe_agent using costom tools but it's not working I'm trying this code class callStaf(BaseModel): def run(self, keyword): return {"status": "submitted", "staff name":…
shihar
  • 48
  • 7
1
vote
2 answers

Why Llama 2 7b version works but not 70b version?

I use something similar to here to run Llama 2. from os.path import dirname from transformers import LlamaForCausalLM, LlamaTokenizer import torch model = "/Llama-2-70b-chat-hf/" # model = "/Llama-2-7b-chat-hf/" tokenizer =…
user14094230
  • 278
  • 2
  • 9
1
vote
1 answer

LangChain: Querying a document and getting structured output using Pydantic with ChatGPT not working well

I am trying to get a LangChain application to query a document that contains different types of information. To facilitate my application, I want to get a response in a specific format, so I am using Pydantic to structure the data as I need, but I…
Dani
  • 43
  • 5
1
vote
3 answers

How to detect whether ConversationalRetrievalChain called the OpenAI LLM?

I have the following code: chat_history = [] embeddings = OpenAIEmbeddings() db = FAISS.from_documents(chunks, embeddings) qa = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0.1), db.as_retriever()) result = qa({"question": "What is stack…
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
1
vote
3 answers

OpenAI from Langchain requires "openai_api_key" even though it is loaded

this is my code: import os from dotenv import load_dotenv,find_dotenv load_dotenv(find_dotenv()) print(os.environ.get("OPEN_AI_KEY")) from langchain.llms import…
Yilmaz
  • 35,338
  • 10
  • 157
  • 202
1
vote
0 answers

Real-time Token Updates from Llama GGML Model in Console

I have the following Python code, along with a few GGML models. The goal is to summarize all my txt files using LLM models rather than sentence transformers. The first section checks the text spacing and converts it into a continuous line rather…
jackfood
  • 11
  • 1
1
vote
0 answers

How to create a vector database of huge set of enterprise documents?

This is a sort of a design question. I am VectorDB newbie. I am working on creating a LLM enable summarisation system for a huge set of documents. These documents will have a certain date in them. Users can be searching them on these dates. When the…
Tanmoy
  • 11
  • 2
1
vote
1 answer

How to add memory to load_qa_chain or How to implement ConversationalRetrievalChain with custom prompt with multiple inputs

I am trying to provide a custom prompt for doing Q&A in langchain. I wasn't able to do that with ConversationalRetrievalChain as it was not allowing for multiple custom inputs in custom prompt. Hence, I used load_qa_chain but with load_qa_chain, I…
Jason
  • 676
  • 1
  • 12
  • 34
1
vote
1 answer

Retrieving the page number from the document in question-answering task [LangChain]

I am building a question-answer app using LangChain. Following the numerous tutorials on web, I was not able to come across of extracting the page number of the relevant answer that is being generated given the fact that I have split the texts from…
1
vote
0 answers

hugging face pipeline error from langchain PydanticUserError:

I'm having following error while trying to load the hugging face pipeline from langchain PydanticUserError: If you use @root_validator with pre=False (the default) you MUST specify skip_on_failure=True. Note that @root_validator is deprecated and…
1
vote
0 answers

GPT2 LLM fine-tuned model not generating expected answer

I am finetuning gpt2 model to answer questions with given faq.json. There is some issue with the answer generated by below code. I am assuming I have not done encoding/decoding of questions and answers correctly. Code - import torch from…
tagg
  • 383
  • 4
  • 7
1
vote
0 answers

How to train ChatGPT on custom data efficiently?

I am working with a dataset (csv format) and creating a custom trained chatbot using the ChatGPT API in Python. Approximately there are 1000 observations and 12 variables. I was able to train the model, however when using asking questions, the…
totnan
  • 67
  • 6
1
vote
0 answers

Entity extraction using custom rules with LLMs

I would like to perform a query on a database using natural language. However, running direct queries is not possible, and I have to do it via an API. For that, given a sentence, I'd like to extract some custom entities from it. For example, if the…
theodre7
  • 125
  • 4
1
vote
0 answers

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…
1 2
3
13 14