Giter Club home page Giter Club logo

chatbot_llama2_pdf's Introduction

How to get watsonx API key and Project ID

Here, we initialize a language model and its embeddings. Here's a brief description of each section of the script:

  • API and Project ID: Watsonx_API and Project_id are variables storing the API key and project ID required to access IBM's cloud services.

  • WatsonX LLM parameters Initialization: Inside the function, a dictionary named params is created, which holds various parameters like maximum and minimum number of tokens to generate, temperature (controlling randomness), and others for configuring the generation behavior of the language model.

  • Credentials: A dictionary named credentials is defined with the URL of IBM's cloud service and the API key to authenticate requests to the service.

  • LLM Initialization: A model object, LLAMA2_model, is created using the Model class, which is initialized with a specific model ID, credentials, parameters, and project ID. Then, an instance of WatsonxLLM is created with LLAMA2_model as an argument, initializing the language model hub llm_hub.

We also initialize embeddings. The embeddings are used to represent text data in a form that machines can understand. They convert human-readable text into numbers (vectors) that capture the semantic meaning of the text.

  • The embeddings are initialized using a class called HuggingFaceInstructEmbeddings pre-trained model named sentence-transformers/all-MiniLM-L6-v2 list of leaderboard of embeddings are available here. This embedding model has shown a good balance in both performance and speed.

Get Your Watsonx API and Project ID

Since watsonx is an IBM Cloud service, credentials such as an API key and a project ID are required when accessing from the outside.

To access the credentials, we've provided a special code for you to claim a USD 200 credit on IBM Cloud at no charge! Here's how to get started:

  1. IBM Cloud Trial Access:
  • Proceed to the "IBM Cloud Trial" section for the unique code and detailed instructions.
  • Follow these instructions to sign up for a non-expiring Lite account at IBM Cloud, which includes the USD 200 credit.
  1. Create Your Watsonx Project:
  • Sign in to IBM watsonx and create a project. Getting IBM watsonx project ID
  • Inside your project on watsonx, navigate to Manage > General to find your project ID for your later use. Create a project ID
  1. Associate Watson Machine Learning Service: After you create a project, you can go to the project’s Manage tab > select the Services and integrations page > click Associate Service > add the Watson Machine Learning service to it.
  2. Generate IBM Cloud User API Key: Lastly, you can follow the below demonstration to create/get your IBM Cloud user API key. Be sure to write your API key down somewhere right after you create it, because you won’t be able to see it again!

Getting IBM cloud user API key

chatbot_llama2_pdf's People

Contributors

edmiand avatar

Watchers

 avatar Kostas Georgiou avatar

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.