barunsaha commited on
Commit
f054614
·
unverified ·
2 Parent(s): 24afa64 34cb50e

Merge pull request #59 from barun-saha/byok

Browse files
Files changed (2) hide show
  1. README.md +20 -13
  2. global_config.py +10 -11
README.md CHANGED
@@ -16,24 +16,17 @@ We spend a lot of time on creating the slides and organizing our thoughts for an
16
  With SlideDeck AI, co-create slide decks on any topic with Generative Artificial Intelligence.
17
  Describe your topic and let SlideDeck AI generate a PowerPoint slide deck for you—it's as simple as that!
18
 
19
- SlideDeck AI is powered by [Mistral-Nemo-Instruct-2407](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407).
20
- Originally, it was built using the Llama 2 API provided by Clarifai.
21
-
22
- *Update (v4.0)*: Legacy SlideDeck AI allowed one-shot generation of a slide deck based on the inputs.
23
- In contrast, SlideDeck AI *Reloaded* enables an iterative workflow with a conversational interface,
24
- where you can create and improve the presentation.
25
-
26
 
27
  # Process
28
 
29
  SlideDeck AI works in the following way:
30
 
31
- 1. Given a topic description, it uses Mistral Nemo Instruct to generate the *initial* content of the slides.
32
  The output is generated as structured JSON data based on a pre-defined schema.
33
  2. Next, it uses the keywords from the JSON output to search and download a few images with a certain probability.
34
  3. Subsequently, it uses the `python-pptx` library to generate the slides,
35
  based on the JSON data from the previous step.
36
- A user can choose from a set of three pre-defined presentation templates.
37
  4. At this stage onward, a user can provide additional instructions to *refine* the content.
38
  For example, one can ask to add another slide or modify an existing slide.
39
  A history of instructions is maintained.
@@ -41,6 +34,20 @@ A history of instructions is maintained.
41
  Clicking on the button will download the file.
42
 
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  # Icons
45
 
46
  SlideDeck AI uses a subset of icons from [bootstrap-icons-1.11.3](https://github.com/twbs/icons)
@@ -50,6 +57,7 @@ SlideDeck AI uses a subset of icons from [bootstrap-icons-1.11.3](https://github
50
 
51
  # Known Issues
52
 
 
53
  - **Connection timeout**: Requests sent to the Hugging Face Inference endpoint might time out. If it still does not work, wait for a while and try again.
54
 
55
  The following is not an issue but might appear as a strange behavior:
@@ -59,11 +67,10 @@ number of allowed characters in the textbox, pasting would not work.
59
 
60
  # Local Development
61
 
62
- SlideDeck AI uses [Mistral-Nemo-Instruct-2407](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407)
63
- via the Hugging Face Inference API.
64
  To run this project by yourself, you need to provide the `HUGGINGFACEHUB_API_TOKEN` API key,
65
- for example, in a `.env` file. For image search, the `PEXEL_API_KEY` should be added.
66
- Visit the respective websites to obtain the keys.
67
 
68
 
69
  # Live Demo
 
16
  With SlideDeck AI, co-create slide decks on any topic with Generative Artificial Intelligence.
17
  Describe your topic and let SlideDeck AI generate a PowerPoint slide deck for you—it's as simple as that!
18
 
 
 
 
 
 
 
 
19
 
20
  # Process
21
 
22
  SlideDeck AI works in the following way:
23
 
24
+ 1. Given a topic description, it uses a Large Language Model (LLM) to generate the *initial* content of the slides.
25
  The output is generated as structured JSON data based on a pre-defined schema.
26
  2. Next, it uses the keywords from the JSON output to search and download a few images with a certain probability.
27
  3. Subsequently, it uses the `python-pptx` library to generate the slides,
28
  based on the JSON data from the previous step.
29
+ A user can choose from a set of pre-defined presentation templates.
30
  4. At this stage onward, a user can provide additional instructions to *refine* the content.
31
  For example, one can ask to add another slide or modify an existing slide.
32
  A history of instructions is maintained.
 
34
  Clicking on the button will download the file.
35
 
36
 
37
+ # Summary of the LLMs
38
+
39
+ Different LLMs offer different styles of content generation. Use one of the following LLMs along with relevant API keys/access tokens, as appropriate, to create the content of the slide deck:
40
+
41
+ | LLM | Provider (code) | Requires API key | Characteristics |
42
+ | :-------- | :------- |:----------------------------------------------------------------------------| :------- |
43
+ | Mistral 7B Instruct v0.2 | Hugging Face (`hf`) | Optional but encouraged; [get here](https://huggingface.co/settings/tokens) | Faster, shorter content |
44
+ | Mistral Nemo Instruct 2407 | Hugging Face (`hf`) | Optional but encouraged; [get here](https://huggingface.co/settings/tokens) | Slower, longer content |
45
+ | Gemini 1.5 Flash | Google Gemini API (`gg`) | Mandatory; [get here](https://aistudio.google.com/apikey) | Faster, longer content |
46
+ | Command R+ | Cohere (`co`) | Mandatory; [get here](https://dashboard.cohere.com/api-keys) | Shorter, simpler content |
47
+
48
+ The Mistral models do not mandatorily require an access token. However, you are encouraged to get and use your own Hugging Face access token.
49
+
50
+
51
  # Icons
52
 
53
  SlideDeck AI uses a subset of icons from [bootstrap-icons-1.11.3](https://github.com/twbs/icons)
 
57
 
58
  # Known Issues
59
 
60
+ - **Model unavailable**: Mistral Nemo currently appears to be unavailable. See this [issue](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407/discussions/83).
61
  - **Connection timeout**: Requests sent to the Hugging Face Inference endpoint might time out. If it still does not work, wait for a while and try again.
62
 
63
  The following is not an issue but might appear as a strange behavior:
 
67
 
68
  # Local Development
69
 
70
+ SlideDeck AI uses LLMs via different providers, such as Hugging Face, Google, and Gemini.
 
71
  To run this project by yourself, you need to provide the `HUGGINGFACEHUB_API_TOKEN` API key,
72
+ for example, in a `.env` file. Alternatively, you can provide the access token in the app's user interface itself (UI). For other LLM providers, the API key can only be specified in the UI. For image search, the `PEXEL_API_KEY` should be made available as an environment variable.
73
+ Visit the respective websites to obtain the API keys.
74
 
75
 
76
  # Live Demo
global_config.py CHANGED
@@ -91,8 +91,7 @@ class GlobalConfig:
91
 
92
  # This is a long text, so not incorporated as a string in `strings.json`
93
  CHAT_USAGE_INSTRUCTIONS = (
94
- 'Briefly describe your topic of presentation in the textbox provided below.'
95
- ' For example:\n'
96
  '- Make a slide deck on AI.'
97
  '\n\n'
98
  'Subsequently, you can add follow-up instructions, e.g.:\n'
@@ -101,22 +100,22 @@ class GlobalConfig:
101
  ' You can also ask it to refine any particular slide, e.g.:\n'
102
  '- Make the slide with title \'Examples of AI\' a bit more descriptive.'
103
  '\n\n'
104
- 'Finally, click on the download button to download the slide deck.'
105
  ' See this [demo video](https://youtu.be/QvAKzNKtk9k) for a brief walkthrough.\n\n'
106
- 'Currently, two LLMs are supported. **Mistral 7B Instruct v0.2** is fast and generates'
107
- ' shorter outputs. On the other hand, **Mistral Nemo Instruct 2407** usually generates'
108
- ' longer outputs but can also be slower. If one is not available, choose the other from'
109
- ' the dropdown list.\n\n'
 
 
 
110
  ' SlideDeck AI does not have access to the Web, apart for searching for images relevant'
111
  ' to the slides. Photos are added probabilistically; transparency needs to be changed'
112
  ' manually, if required.\n\n'
113
  '[SlideDeck AI](https://github.com/barun-saha/slide-deck-ai) is an Open-Source project,'
114
  ' released under the'
115
  ' [MIT license](https://github.com/barun-saha/slide-deck-ai?tab=MIT-1-ov-file#readme).'
116
- ' It is is powered by'
117
- ' [Mistral-Nemo-Instruct-2407](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407)'
118
- ' and [Mistral 7B v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2).\n\n'
119
- '---\n\n'
120
  '© Copyright 2023-2024 Barun Saha.\n\n'
121
  )
122
 
 
91
 
92
  # This is a long text, so not incorporated as a string in `strings.json`
93
  CHAT_USAGE_INSTRUCTIONS = (
94
+ 'Briefly describe your topic of presentation in the textbox provided below. For example:\n'
 
95
  '- Make a slide deck on AI.'
96
  '\n\n'
97
  'Subsequently, you can add follow-up instructions, e.g.:\n'
 
100
  ' You can also ask it to refine any particular slide, e.g.:\n'
101
  '- Make the slide with title \'Examples of AI\' a bit more descriptive.'
102
  '\n\n'
103
+ 'Finally, click on the download button at the bottom to download the slide deck.'
104
  ' See this [demo video](https://youtu.be/QvAKzNKtk9k) for a brief walkthrough.\n\n'
105
+ 'Currently, three LLMs providers and four LLMs are supported:'
106
+ ' **Mistral 7B Instruct v0.2** and **Mistral Nemo Instruct 2407** via Hugging Face'
107
+ ' Inference Endpoint; **Gemini 1.5 Flash** via Gemini API; and **Command R+** via Cohere'
108
+ ' API. If one is not available, choose the other from the dropdown list. A [summary of'
109
+ ' the supported LLMs]('
110
+ 'https://github.com/barun-saha/slide-deck-ai/blob/main/README.md#summary-of-the-llms)'
111
+ ' is available for reference.\n\n'
112
  ' SlideDeck AI does not have access to the Web, apart for searching for images relevant'
113
  ' to the slides. Photos are added probabilistically; transparency needs to be changed'
114
  ' manually, if required.\n\n'
115
  '[SlideDeck AI](https://github.com/barun-saha/slide-deck-ai) is an Open-Source project,'
116
  ' released under the'
117
  ' [MIT license](https://github.com/barun-saha/slide-deck-ai?tab=MIT-1-ov-file#readme).'
118
+ '\n\n---\n\n'
 
 
 
119
  '© Copyright 2023-2024 Barun Saha.\n\n'
120
  )
121