Git Product home page Git Product logo

curiousily / get-things-done-with-prompt-engineering-and-langchain Goto Github PK

View Code? Open in Web Editor NEW
941.0 16.0 320.0 15.41 MB

LangChain & Prompt Engineering tutorials on Large Language Models (LLMs) such as ChatGPT with custom data. Jupyter notebooks on loading and indexing data, creating prompt templates, CSV agents, and using retrieval QA chains to query the custom data. Projects for using a private LLM (Llama 2) for chat with PDF files, tweets sentiment analysis.

Home Page: https://www.mlexpert.io/prompt-engineering

License: Apache License 2.0

Jupyter Notebook 100.00%
chatgpt gpt-4 gpt4 prompt-engineering artificial-intelligence deep-learning language-models openai python langchain

get-things-done-with-prompt-engineering-and-langchain's Introduction

Hi there ๐Ÿ‘‹

Hey, I am Venelin. Thanks for stopping by!

I am from an awesome little country called Bulgaria.

I work as a full-time Machine Learning engineer and write tutorials on basic and advanced topics (videos, posts, and code - lots of it).

You can:

Have an awesome day!

get-things-done-with-prompt-engineering-and-langchain's People

Contributors

curiousily avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

get-things-done-with-prompt-engineering-and-langchain's Issues

notebook 15 dependency error

Dependency Error on 15.langchain-quickstart-with-llama-2.ipynb

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
transformers 4.33.2 requires tokenizers!=0.11.3,<0.14,>=0.11.1, but you have tokenizers 0.14.0 which is incompatible.

PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?

I tried to run your google collab notepad: "06.private-gpt4all-qa-pdf.ipynb". I didn't edit your code, but just started the cells step by step. In this section of the code:

images = convert_from_path("ms-financial-statement.pdf", dpi=88)
len(images)

I had this kind of error:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/pdf2image/pdf2image.py](https://localhost:8080/#) in pdfinfo_from_path(pdf_path, userpw, ownerpw, poppler_path, rawdates, timeout)
    567             env["LD_LIBRARY_PATH"] = poppler_path + ":" + env.get("LD_LIBRARY_PATH", "")
--> 568         proc = Popen(command, env=env, stdout=PIPE, stderr=PIPE)
    569 

4 frames
FileNotFoundError: [Errno 2] No such file or directory: 'pdfinfo'

During handling of the above exception, another exception occurred:

PDFInfoNotInstalledError                  Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/pdf2image/pdf2image.py](https://localhost:8080/#) in pdfinfo_from_path(pdf_path, userpw, ownerpw, poppler_path, rawdates, timeout)
    592 
    593     except OSError:
--> 594         raise PDFInfoNotInstalledError(
    595             "Unable to get page count. Is poppler installed and in PATH?"
    596         )

PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?

here is a screenshot:
image

I need to load my custom model from pre trained model

Hello

I need to load my custom model from pre trained model

Here is the code but he giving error like 'HFValidationError: Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is'

Please Help

model = "shaileshp/trained-test-model-1-merged"

dtype = torch.bfloat16 if torch.cuda.get_device_capability()[0] == 8 else torch.float16

model = AutoModelForCausalLM.from_pretrained(
model,
return_dict=True,
device_map="auto",
load_in_8bit=True,
torch_dtype=dtype,
#trust_remote_code=True,
)

Changing the template and adding customzation in pandas_dataframe_agent/csv agent

Hi ,
Thanks for veery helping notebooks

Hope all of you are doing great.

I am developing a chatbot/question-answer agent using GPT-4 on pandas dataframe in langchain. I am able to make it work with following code:

gpt4_agent = create_pandas_dataframe_agent(
    ChatOpenAI(temperature=0,
               openai_api_key=OPENAI_API_KEY,
               model_name = 'gpt-4'),[sub_listing_df,company_df], verbose=True
)

But, I think that I can make it more optimized by changing some paramters, and especially prompt template: Here is the prompt template being used by default:

display(Markdown(gpt4_agent.agent.llm_chain.prompt.template))
----------------------
You are working with {num_dfs} pandas dataframes in Python named df1, df2, etc. You should use the tools below to answer the question posed of you:

python_repl_ast: A Python shell. Use this to execute python commands. Input should be a valid python command. When using this tool, sometimes output is abbreviated - make sure it does not look abbreviated before using it in your answer.

Use the following format:

Question: the input question you must answer Thought: you should always think about what to do Action: the action to take, should be one of [python_repl_ast] Action Input: the input to the action Observation: the result of the action ... (this Thought/Action/Action Input/Observation can repeat N times) Thought: I now know the final answer Final Answer: the final answer to the original input question

This is the result of print(df.head()) for each dataframe: {dfs_head}

Begin! Question: {input} {agent_scratchpad}

How can I change the prompt template?

Thanks for any help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.