8000 GitHub - todd-jang/chatbot_data
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

todd-jang/chatbot_data

Repository files navigation

이 프로젝트에서는 Flask라는 인기 있는 웹 프레임워크와 LangChain이라는 대형 언어 모델(LLM) 작업을 위한 또 다른 인기 있는 프레임워크를 사용하여 자신의 PDF 파일에 대한 챗봇을 만들 것입니다. 개발할 챗봇은 사용자와 텍스트를 통해 상호작용할 뿐만 아니라 특정 문서의 내용과 관련된 질문을 이해하고 답변할 수 있습니다.

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  
0