-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from facebookincubator/arvind/website-content
[Website] Update docs content and home page design
- Loading branch information
Showing
46 changed files
with
280 additions
and
1,328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"label": "LLM Connections", | ||
"position": 4, | ||
"link": { | ||
"type": "generated-index", | ||
"description": "Learn how to connect CP4M with your LLM service provider." | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
docs/docs/connecting-your-llm/connecting-llama-via-huggingface.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Connecting to Llama via Hugging Face | ||
|
||
To connect CP4M to Llama via Hugging Face, you will need: | ||
1. A Hugging Face account | ||
2. Access to the Llama model from Meta | ||
|
||
## Sign up for a Hugging Face account | ||
Hugging Face is a platform that helps you build, deploy, and train machine learning models. You can sign up for an account [here](https://huggingface.co/join). | ||
|
||
![Hugging Face Home Page](./img/hugging-face-home-page.png) | ||
|
||
## Accessing the Llama model on Hugging Face | ||
Hugging Face has a large repository of machine learning models for a variety of use cases accessible [here](https://huggingface.co/models). | ||
|
||
You can search for the LLama model from Meta of your choice. For the purposes of this tutorial, we will be using the [LLama-2-7b-chat-hf model](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf). | ||
|
||
In order to use the Llama model, you will need to accept the Llama 2 Community License Agreement on the [model page](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf). | ||
|
||
![Gated model agremeent](./img/hugging-face-gated-model-agreement.png) | ||
|
||
Once your account is approved, the model page will inform you that you have been granted access. | ||
|
||
![Gated model access](./img/hugging-face-gated-model-access.png) | ||
|
||
## Deploying model using Inference API | ||
The fastest way to deploy Llama is through Hugging Face's serverless Inference API. | ||
|
||
1. Go to the [Llama model page](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf). | ||
2. On the top right, click on the **Deploy** dropdown button. | ||
|
||
![Model Deploy](./img/hugging-face-model-deploy.png) | ||
|
||
|
||
3. In the dropdown, click the **Inference API (serverless)** option. *Note: Using Inference API requires a [Hugging Face Pro subscription](https://huggingface.co/pricing)*. | ||
|
||
![Inference API First Time](./img/hugging-face-inference-api-first-time.png) | ||
|
||
4. On the new modal, click the **Token** dropdown then click **+ New access token**. | ||
|
||
![Inference API New Token](./img/hugging-face-inference-api-new-token.png) | ||
|
||
5. On the access tokens page, click the **New Token** button. | ||
|
||
![Access Token Page](./img/hugging-face-access-token.png) | ||
|
||
6. Create a new access token with the **Write** permission. | ||
|
||
![Create Access Token Modal](./img/hugging-face-create-access-token.png) | ||
|
||
7. Go back to the Model Deploy > Inference API page [here](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf?inference_api=true). Your newly created access token should now be populated in the **Token** section. | ||
|
||
## Updating your CP4M config from Inference API | ||
7. Copy and paste the *API_URL* on the Deploy Inference API modal to your CP4M config file in the "\[\[plugins]] endpoint" entry. If you are using the Llama-2-7b-chat-hf model, it should be "https://api-inference.huggingface.co/models/meta-llama/Llama-2-7b-chat-hf". | ||
|
||
![Inference API code](./img/hugging-face-inference-api-code.png) | ||
|
||
8. Click **Show API token**. Copy and paste this API token to your CP4M config file in the "\[\[plugins]] api_key" entry. | ||
|
||
Congratulations! You have now successfully set up CP4M with Llama via Hugging Face. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Connecting to OpenAI | ||
|
||
Coming soon... |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+94.7 KB
docs/docs/connecting-your-llm/img/hugging-face-create-access-token.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.1 KB
docs/docs/connecting-your-llm/img/hugging-face-gated-model-access.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.5 KB
docs/docs/connecting-your-llm/img/hugging-face-gated-model-agreement.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+329 KB
docs/docs/connecting-your-llm/img/hugging-face-inference-api-first-time.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+338 KB
docs/docs/connecting-your-llm/img/hugging-face-inference-api-new-token.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"label": "Messaging Integrations", | ||
"position": 3, | ||
"link": { | ||
"type": "generated-index", | ||
"description": "Learn how to integrate CP4M with your messaging accounts like Whatsapp." | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
docs/docs/messaging-integrations/connecting-to-instagram-direct.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Connecting to Instagram Direct | ||
|
||
Coming soon... |
51 changes: 51 additions & 0 deletions
51
docs/docs/messaging-integrations/connecting-to-messenger.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Connecting to Messenger | ||
|
||
To connect CP4M to Facebook Messenger, you will need: | ||
1. A Facebook account registered as a Meta developer | ||
2. A Meta app to integrate with Meta APIs | ||
3. A Facebook Page for users to interact with over Messenger | ||
|
||
## Getting Meta developer access | ||
To register as a Meta developer, you can follow the steps [here](https://developers.facebook.com/docs/development/register). | ||
|
||
## Creating a Meta app | ||
You can see all of your existing Meta developer apps in the [Meta Developer App Dashboard](https://developers.facebook.com/apps/). | ||
|
||
To create a new app, click on the **Create App** button. The steps for the app creation process are detailed [here](https://developers.facebook.com/docs/development/create-an-app). | ||
|
||
## Create a Facebook page | ||
If you don't already have a Facebook page for Messenger interactions, you can follow the steps [here](https://www.facebook.com/business/help/1199464373557428?id=418112142508425) to create a new page. | ||
|
||
## Enabling Messenger API Access on your Meta app | ||
In the [Meta Developer App Dashboard](https://developers.facebook.com/apps/): | ||
1. Click on your Meta app | ||
2. On the **Dashboard** page, find the **Add products to your app** section. | ||
3. On the **Messenger** tile, click the **Set up** button. | ||
|
||
![Messenger Developer Dashboard](./img/meta_developer_dashboard_messenger.png) | ||
|
||
4. On the "1. Configure webhooks" section, click the **Configure** button. | ||
|
||
![Configure webhooks setup](./img/meta_developer_messenger_webhooks.png) | ||
|
||
5. Follow the steps in the [Messenger Webhooks documentation](https://developers.facebook.com/docs/messenger-platform/webhooks) to configure the Callback URL and Verification Token for your server. | ||
|
||
![Callback URL Setup](./img/meta_developer_messenger_callback_url.png) | ||
|
||
6. On the "2. Generate access tokens" section, click the **Add Subscriptions** button on an existing Facebook page which you would like your app to have Messenger API access. | ||
|
||
![Messenger add subscriptions](./img/meta_developer_messenger_add_subscriptions.png) | ||
|
||
7. At minimum, select the following Page Subscriptions. Learn more about all the Page Subscription options [here](https://developers.facebook.com/docs/messenger-platform/webhooks#subscribe-to-meta-webhooks): | ||
a. messages | ||
b. messaging_postbacks | ||
|
||
8. Click the **Confirm** button to save your page subscription choices. | ||
|
||
![Messenger choose subscriptions](./img/meta_developer_messenger_choose_subscriptions.png) | ||
|
||
9. Finally, on the "3. Complete App Review" section, follow the steps to complete the App Review process so that your app can access production data. You can learn more about Meta's app review process [here](https://developers.facebook.com/docs/resp-plat-initiatives/app-review). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# Connecting to Whatsapp | ||
|
||
Coming soon... |
Binary file added
BIN
+380 KB
docs/docs/messaging-integrations/img/meta_developer_dashboard_messenger.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+306 KB
.../docs/messaging-integrations/img/meta_developer_messenger_add_subscriptions.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+61.5 KB
docs/docs/messaging-integrations/img/meta_developer_messenger_callback_url.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+114 KB
...cs/messaging-integrations/img/meta_developer_messenger_choose_subscriptions.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+133 KB
docs/docs/messaging-integrations/img/meta_developer_messenger_webhooks.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# System Architecture | ||
|
||
Coming soon... |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.