Spaces:
Sleeping
Sleeping
Richard Fan
commited on
Commit
·
8d0fdb1
1
Parent(s):
e477775
new advanced usage page
Browse files- README.md +12 -56
- advanced_usage.md +91 -0
- readme_images/fork.png +0 -0
- readme_images/openai.png +0 -0
- readme_images/secrets.png +0 -0
- readme_images/settings.png +0 -0
- readme_images/trigger.png +0 -0
README.md
CHANGED
@@ -67,67 +67,23 @@ You can also send yourself an email of the digest by creating a SendGrid account
|
|
67 |
The recommended way to get started using this repository is to:
|
68 |
|
69 |
1. Fork the repository
|
70 |
-
2. Modify `config.yaml` and merge the changes into your main branch.
|
71 |
-
3.
|
72 |
-
|
73 |
-
|
74 |
-
- `
|
75 |
-
- `
|
76 |
-
|
77 |
-
- `TO_EMAIL` Only if you don't have it set in `config.yaml`
|
78 |
-
6. Manually trigger the action or wait until the scheduled action takes place.
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
### Running as a github action with SMTP credentials.
|
84 |
-
|
85 |
-
An alternative way to get started using this repository is to:
|
86 |
-
|
87 |
-
1. Fork the repository
|
88 |
-
2. Modify `config.yaml` and merge the changes into your main branch. If you want a different schedule than Sunday through Thursday at 1:25PM UTC, then also modify the file `.github/workflows/daily_pipeline.yaml`
|
89 |
-
3. Create or fetch your API key for [OpenAI](https://platform.openai.com/account/api-keys). Note: you will need an OpenAI account.
|
90 |
-
4. Find your email provider's SMTP settings and set the secret `MAIL_CONNECTION` to that. It should be in the form `smtp://user:password@server:port` or `smtp+starttls://user:password@server:port`. Alternatively, if you are using Gmail, you can set `MAIL_USERNAME` and `MAIL_PASSWORD` instead, using an [application password](https://support.google.com/accounts/answer/185833).
|
91 |
-
5. Set the following secrets [(under settings, Secrets and variables, repository secrets)](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository):
|
92 |
-
- `OPENAI_API_KEY`
|
93 |
-
- `MAIL_CONNECTION` (see above)
|
94 |
-
- `MAIL_PASSWORD` (only if you don't have `MAIL_CONNECTION` set)
|
95 |
-
- `MAIL_USERNAME` (only if you don't have `MAIL_CONNECTION` set)
|
96 |
-
- `FROM_EMAIL` (only if you don't have it set in `config.yaml`)
|
97 |
-
- `TO_EMAIL` (only if you don't have it set in `config.yaml`)
|
98 |
-
6. Manually trigger the action or wait until the scheduled action takes place.
|
99 |
-
|
100 |
-
### Running as a github action without emails
|
101 |
-
|
102 |
-
If you do not wish to create a SendGrid account or use your email authentication, the action will also emit an artifact containing the HTML output. Simply do not create the SendGrid or SMTP secrets.
|
103 |
-
|
104 |
-
You can access this digest as part of the github action artifact.
|
105 |
-
|
106 |
-

|
107 |
-
|
108 |
-
### Running from the command line
|
109 |
-
|
110 |
-
If you do not wish to fork this repository, and would prefer to clone and run it locally instead:
|
111 |
-
|
112 |
-
1. Install the requirements in `src/requirements.txt`
|
113 |
-
2. Modify the configuration file `config.yaml`
|
114 |
-
3. Create or fetch your API key for [OpenAI](https://platform.openai.com/account/api-keys). Note: you will need an OpenAI account.
|
115 |
-
4. Create or fetch your API key for [SendGrid](https://app.SendGrid.com/settings/api_keys) (optional, if you want the script to email you)
|
116 |
-
5. Set the following secrets as environment variables:
|
117 |
-
- `OPENAI_API_KEY`
|
118 |
-
- `SENDGRID_API_KEY` (only if using SendGrid)
|
119 |
-
- `FROM_EMAIL` (only if using SendGrid and if you don't have it set in `config.yaml`. Note that this value must match the email you used to create the SendGrid API Key.)
|
120 |
-
- `TO_EMAIL` (only if using SendGrid and if you don't have it set in `config.yaml`)
|
121 |
-
6. Run `python action.py`.
|
122 |
-
7. If you are not using SendGrid, the html of the digest will be written to `digest.html`. You can then use your favorite webbrowser to view it.
|
123 |
-
|
124 |
-
You may want to use something like crontab to schedule the digest.
|
125 |
|
126 |
### Running with a user interface
|
127 |
|
128 |
-
|
|
|
|
|
|
|
129 |
|
130 |
-
Run `python src/app.py` and go to the local URL. From there you will be able to preview the papers from today, as well as the generated digests.
|
131 |
|
132 |
## ✅ Roadmap
|
133 |
|
|
|
67 |
The recommended way to get started using this repository is to:
|
68 |
|
69 |
1. Fork the repository
|
70 |
+
2. Modify `config.yaml` and merge the changes into your main branch.
|
71 |
+
3. Set the following secrets [(under settings, Secrets and variables, repository secrets)](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository). See [Advanced Usage](./advanced_usage.md) for more details on how to create and get OpenAi and SendGrid API keys:
|
72 |
+
- `OPENAI_API_KEY` From [OpenAI](https://platform.openai.com/account/api-keys)
|
73 |
+
- `SENDGRID_API_KEY` From [SendGrid](https://app.SendGrid.com/settings/api_keys)
|
74 |
+
- `FROM_EMAIL` This value must match the email you used to create the SendGrid API Key.
|
75 |
+
- `TO_EMAIL`
|
76 |
+
4. Manually trigger the action or wait until the scheduled action takes place.
|
|
|
|
|
77 |
|
78 |
+
See [Advanced Usage](./advanced_usage.md) for more details, including step-by-step images, further customization, and alternate usage.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
### Running with a user interface
|
81 |
|
82 |
+
To locally run the same UI as the Huggign Face space:
|
83 |
+
|
84 |
+
1. Install the requirements in `src/requirements.txt` as well as `gradio`.
|
85 |
+
2. Run `python src/app.py` and go to the local URL. From there you will be able to preview the papers from today, as well as the generated digests.
|
86 |
|
|
|
87 |
|
88 |
## ✅ Roadmap
|
89 |
|
advanced_usage.md
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Advanced Usage
|
2 |
+
|
3 |
+
## Step-by-step instructions
|
4 |
+
|
5 |
+
### Fork the repository
|
6 |
+
|
7 |
+
Click the fork button at the top of this repository page, as seen on the below image. This will create your own version of the repository, including your own set of github actions
|
8 |
+
|
9 |
+

|
10 |
+
|
11 |
+
### Modify the configuration file
|
12 |
+
|
13 |
+
Modify `config.yaml` by cloning the respository and merging your changes
|
14 |
+
|
15 |
+
### Create and Fetch your API Keys
|
16 |
+
|
17 |
+
Create or fetch your API key for [OpenAI](https://platform.openai.com/account/api-keys). Note: you will need an OpenAI account.
|
18 |
+

|
19 |
+
|
20 |
+
Create or fetch your API key for [SendGrid](https://app.SendGrid.com/settings/api_keys). You will need a SendGrid account. The free tier will generally suffice. Make sure to [verify your sender identity](https://docs.sendgrid.com/for-developers/sending-email/sender-identity).
|
21 |
+
|
22 |
+
### Set the secrets for the github action
|
23 |
+
|
24 |
+
Go to the Settings tab on the top of this page, and then the "Actions" menu under "Secrets and variables":
|
25 |
+

|
26 |
+
|
27 |
+
Create a new repository secret for each of the following
|
28 |
+
- `OPENAI_API_KEY`
|
29 |
+
- `SENDGRID_API_KEY`
|
30 |
+
- `FROM_EMAIL`
|
31 |
+
- `TO_EMAIL`
|
32 |
+
|
33 |
+

|
34 |
+
|
35 |
+
### Manually trigger the action, or wait until the scheduled trigger
|
36 |
+
|
37 |
+
Go to the actions tab, and then click on "Daily Workflow" and "Run Workflow"
|
38 |
+
|
39 |
+

|
40 |
+
|
41 |
+
## Additional Configuration
|
42 |
+
|
43 |
+
- If you want a different schedule than Sunday through Thursday at 1:25PM UTC, then modify the file `.github/workflows/daily_pipeline.yaml`
|
44 |
+
|
45 |
+
|
46 |
+
## Alternative Usage
|
47 |
+
|
48 |
+
Running `src/action.py` will generate an HTML file that can then be emailed. The following alternative usage methods all use that pattern
|
49 |
+
|
50 |
+
### Running as a github action with SMTP credentials.
|
51 |
+
|
52 |
+
An alternative way to get started using this repository is to:
|
53 |
+
|
54 |
+
1. Fork the repository
|
55 |
+
2. Modify `config.yaml` and merge the changes into your main branch. If you want a different schedule than Sunday through Thursday at 1:25PM UTC, then also modify the file `.github/workflows/daily_pipeline.yaml`
|
56 |
+
3. Create or fetch your API key for [OpenAI](https://platform.openai.com/account/api-keys).
|
57 |
+
4. Find your email provider's SMTP settings and set the secret `MAIL_CONNECTION` to that. It should be in the form `smtp://user:password@server:port` or `smtp+starttls://user:password@server:port`. Alternatively, if you are using Gmail, you can set `MAIL_USERNAME` and `MAIL_PASSWORD` instead, using an [application password](https://support.google.com/accounts/answer/185833).
|
58 |
+
5. Set the following secrets [(under settings, Secrets and variables, repository secrets)](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository):
|
59 |
+
- `OPENAI_API_KEY`
|
60 |
+
- `MAIL_CONNECTION` (see above)
|
61 |
+
- `MAIL_PASSWORD` (only if you don't have `MAIL_CONNECTION` set)
|
62 |
+
- `MAIL_USERNAME` (only if you don't have `MAIL_CONNECTION` set)
|
63 |
+
- `FROM_EMAIL` (only if you don't have it set in `config.yaml`)
|
64 |
+
- `TO_EMAIL` (only if you don't have it set in `config.yaml`)
|
65 |
+
6. Manually trigger the action or wait until the scheduled action takes place.
|
66 |
+
|
67 |
+
### Running as a github action without emails
|
68 |
+
|
69 |
+
If you do not wish to create a SendGrid account or use your email authentication, the action will also emit an artifact containing the HTML output. Simply do not create the SendGrid or SMTP secrets.
|
70 |
+
|
71 |
+
You can access this digest as part of the github action artifact.
|
72 |
+
|
73 |
+

|
74 |
+
|
75 |
+
### Running from the command line
|
76 |
+
|
77 |
+
If you do not wish to fork this repository, and would prefer to clone and run it locally instead:
|
78 |
+
|
79 |
+
1. Install the requirements in `src/requirements.txt`
|
80 |
+
2. Modify the configuration file `config.yaml`
|
81 |
+
3. Create or fetch your API key for [OpenAI](https://platform.openai.com/account/api-keys).
|
82 |
+
4. Create or fetch your API key for [SendGrid](https://app.SendGrid.com/settings/api_keys) (optional, if you want the script to email you)
|
83 |
+
5. Set the following secrets as environment variables:
|
84 |
+
- `OPENAI_API_KEY`
|
85 |
+
- `SENDGRID_API_KEY` (only if using SendGrid)
|
86 |
+
- `FROM_EMAIL` (only if using SendGrid and if you don't have it set in `config.yaml`. Note that this value must match the email you used to create the SendGrid Api Key.)
|
87 |
+
- `TO_EMAIL` (only if using SendGrid and if you don't have it set in `config.yaml`)
|
88 |
+
6. Run `python action.py`.
|
89 |
+
7. If you are not using SendGrid, the html of the digest will be written to `digest.html`. You can then use your favorite webbrowser to view it.
|
90 |
+
|
91 |
+
You may want to use something like crontab to schedule the digest.
|
readme_images/fork.png
ADDED
![]() |
readme_images/openai.png
ADDED
![]() |
readme_images/secrets.png
ADDED
![]() |
readme_images/settings.png
ADDED
![]() |
readme_images/trigger.png
CHANGED
![]() |
![]() |