Spaces:
Running
Running
Merge pull request #78 from barun-saha/visual
Browse filesAdd Gemini Flash Lite and update usage instructions
- README.md +15 -11
- app.py +3 -2
- global_config.py +14 -8
- strings.json +2 -1
README.md
CHANGED
@@ -42,17 +42,21 @@ Based on several experiments, SlideDeck AI generally recommends the use of Mistr
|
|
42 |
|
43 |
The supported 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:
|
44 |
|
45 |
-
| LLM | Provider (code) | Requires API key
|
46 |
-
|:---------------------------------| :-------
|
47 |
-
| Mistral 7B Instruct v0.2 | Hugging Face (`hf`) | Optional but encouraged; [get here](https://huggingface.co/settings/tokens) | Faster, shorter content |
|
48 |
-
| Mistral NeMo Instruct 2407 | Hugging Face (`hf`) | Optional but encouraged; [get here](https://huggingface.co/settings/tokens) | Slower, longer content |
|
49 |
-
| Gemini 1.5 Flash | Google Gemini API (`gg`) | Mandatory; [get here](https://aistudio.google.com/apikey)
|
50 |
-
| Gemini 2.0 Flash | Google Gemini API (`gg`) | Mandatory; [get here](https://aistudio.google.com/apikey)
|
51 |
-
|
|
52 |
-
|
|
53 |
-
| Llama 3.
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
56 |
|
57 |
In addition, offline LLMs provided by Ollama can be used. Read below to know more.
|
58 |
|
|
|
42 |
|
43 |
The supported 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:
|
44 |
|
45 |
+
| LLM | Provider (code) | Requires API key | Characteristics |
|
46 |
+
|:---------------------------------| :------- |:-------------------------------------------------------------------------------------|:-------------------------|
|
47 |
+
| Mistral 7B Instruct v0.2 | Hugging Face (`hf`) | Optional but strongly encouraged; [get here](https://huggingface.co/settings/tokens) | Faster, shorter content |
|
48 |
+
| Mistral NeMo Instruct 2407 | Hugging Face (`hf`) | Optional but strongly encouraged; [get here](https://huggingface.co/settings/tokens) | Slower, longer content |
|
49 |
+
| Gemini 1.5 Flash | Google Gemini API (`gg`) | Mandatory; [get here](https://aistudio.google.com/apikey) | Faster, longer content |
|
50 |
+
| Gemini 2.0 Flash | Google Gemini API (`gg`) | Mandatory; [get here](https://aistudio.google.com/apikey) | Faster, longer content |
|
51 |
+
| Gemini 2.0 Flash Lite | Google Gemini API (`gg`) | Mandatory; [get here](https://aistudio.google.com/apikey) | Faster, longer content |
|
52 |
+
| Command R+ | Cohere (`co`) | Mandatory; [get here](https://dashboard.cohere.com/api-keys) | Shorter, simpler content |
|
53 |
+
| Llama 3.3 70B Instruct Turbo | Together AI (`to`) | Mandatory; [get here](https://api.together.ai/settings/api-keys) | Detailed, slower |
|
54 |
+
| Llama 3.1 8B Instruct Turbo 128K | Together AI (`to`) | Mandatory; [get here](https://api.together.ai/settings/api-keys) | Shorter |
|
55 |
+
|
56 |
+
The Mistral models (via Hugging Face) do not mandatorily require an access token. In other words, you are always free to use these two LLMs, subject to Hugging Face's usage constrains. However, you are strongly encouraged to get and use your own Hugging Face access token.
|
57 |
+
|
58 |
+
**IMPORTANT**: SlideDeck AI does **NOT** store your API keys/tokens or transmit them elsewhere. If you provide your API key, it is only used to invoke the relevant LLM to generate contents. That's it! This is an
|
59 |
+
Open-Source project, so feel free to audit the code and convince yourself.
|
60 |
|
61 |
In addition, offline LLMs provided by Ollama can be used. Read below to know more.
|
62 |
|
app.py
CHANGED
@@ -320,10 +320,11 @@ def set_up_chat_ui():
|
|
320 |
except Exception as ex:
|
321 |
handle_error(
|
322 |
f'An unexpected error occurred while generating the content: {ex}'
|
323 |
-
'\nPlease try again later, possibly with different inputs.'
|
324 |
' Alternatively, try selecting a different LLM from the dropdown list.'
|
325 |
' If you are using Cohere, Gemini, or Together AI models, make sure that you have'
|
326 |
-
' provided a correct API key.'
|
|
|
327 |
True
|
328 |
)
|
329 |
return
|
|
|
320 |
except Exception as ex:
|
321 |
handle_error(
|
322 |
f'An unexpected error occurred while generating the content: {ex}'
|
323 |
+
'\n\nPlease try again later, possibly with different inputs.'
|
324 |
' Alternatively, try selecting a different LLM from the dropdown list.'
|
325 |
' If you are using Cohere, Gemini, or Together AI models, make sure that you have'
|
326 |
+
' provided a correct API key.'
|
327 |
+
' Read **[how to get free LLM API keys](https://github.com/barun-saha/slide-deck-ai?tab=readme-ov-file#summary-of-the-llms)**.',
|
328 |
True
|
329 |
)
|
330 |
return
|
global_config.py
CHANGED
@@ -40,7 +40,12 @@ class GlobalConfig:
|
|
40 |
'max_new_tokens': 8192,
|
41 |
'paid': True,
|
42 |
},
|
43 |
-
'[gg]gemini-2.0-flash
|
|
|
|
|
|
|
|
|
|
|
44 |
'description': 'fast, detailed',
|
45 |
'max_new_tokens': 8192,
|
46 |
'paid': True,
|
@@ -74,7 +79,7 @@ class GlobalConfig:
|
|
74 |
'- **[to]**: Together AI\n\n'
|
75 |
'[Find out more](https://github.com/barun-saha/slide-deck-ai?tab=readme-ov-file#summary-of-the-llms)'
|
76 |
)
|
77 |
-
DEFAULT_MODEL_INDEX =
|
78 |
LLM_MODEL_TEMPERATURE = 0.2
|
79 |
LLM_MODEL_MIN_OUTPUT_LENGTH = 100
|
80 |
LLM_MODEL_MAX_INPUT_LENGTH = 400 # characters
|
@@ -127,13 +132,14 @@ class GlobalConfig:
|
|
127 |
'\n\n'
|
128 |
'Finally, click on the download button at the bottom to download the slide deck.'
|
129 |
' See this [demo video](https://youtu.be/QvAKzNKtk9k) for a brief walkthrough.\n\n'
|
130 |
-
'
|
131 |
-
'
|
132 |
-
'
|
133 |
-
'
|
|
|
134 |
' the supported LLMs]('
|
135 |
'https://github.com/barun-saha/slide-deck-ai/blob/main/README.md#summary-of-the-llms)'
|
136 |
-
' is available for reference.\n\n'
|
137 |
' SlideDeck AI does not have access to the Web, apart for searching for images relevant'
|
138 |
' to the slides. Photos are added probabilistically; transparency needs to be changed'
|
139 |
' manually, if required.\n\n'
|
@@ -141,7 +147,7 @@ class GlobalConfig:
|
|
141 |
' released under the'
|
142 |
' [MIT license](https://github.com/barun-saha/slide-deck-ai?tab=MIT-1-ov-file#readme).'
|
143 |
'\n\n---\n\n'
|
144 |
-
'© Copyright 2023-
|
145 |
)
|
146 |
|
147 |
|
|
|
40 |
'max_new_tokens': 8192,
|
41 |
'paid': True,
|
42 |
},
|
43 |
+
'[gg]gemini-2.0-flash': {
|
44 |
+
'description': 'fast, detailed',
|
45 |
+
'max_new_tokens': 8192,
|
46 |
+
'paid': True,
|
47 |
+
},
|
48 |
+
'[gg]gemini-2.0-flash-lite-preview-02-05': {
|
49 |
'description': 'fast, detailed',
|
50 |
'max_new_tokens': 8192,
|
51 |
'paid': True,
|
|
|
79 |
'- **[to]**: Together AI\n\n'
|
80 |
'[Find out more](https://github.com/barun-saha/slide-deck-ai?tab=readme-ov-file#summary-of-the-llms)'
|
81 |
)
|
82 |
+
DEFAULT_MODEL_INDEX = 4
|
83 |
LLM_MODEL_TEMPERATURE = 0.2
|
84 |
LLM_MODEL_MIN_OUTPUT_LENGTH = 100
|
85 |
LLM_MODEL_MAX_INPUT_LENGTH = 400 # characters
|
|
|
132 |
'\n\n'
|
133 |
'Finally, click on the download button at the bottom to download the slide deck.'
|
134 |
' See this [demo video](https://youtu.be/QvAKzNKtk9k) for a brief walkthrough.\n\n'
|
135 |
+
'Remember, the conversational interface is meant to (and will) update yor *initial*'
|
136 |
+
' slide deck. If you want to create a new slide deck on a different topic,'
|
137 |
+
' start a new chat session by reloading this page.\n\n'
|
138 |
+
'Currently, eight *free-to-use* LLMs from four different providers are supported.'
|
139 |
+
' If one is not available, choose the other from the dropdown list. A [summary of'
|
140 |
' the supported LLMs]('
|
141 |
'https://github.com/barun-saha/slide-deck-ai/blob/main/README.md#summary-of-the-llms)'
|
142 |
+
' is available for reference. SlideDeck AI does **NOT** store your API keys.\n\n'
|
143 |
' SlideDeck AI does not have access to the Web, apart for searching for images relevant'
|
144 |
' to the slides. Photos are added probabilistically; transparency needs to be changed'
|
145 |
' manually, if required.\n\n'
|
|
|
147 |
' released under the'
|
148 |
' [MIT license](https://github.com/barun-saha/slide-deck-ai?tab=MIT-1-ov-file#readme).'
|
149 |
'\n\n---\n\n'
|
150 |
+
'© Copyright 2023-2025 Barun Saha.\n\n'
|
151 |
)
|
152 |
|
153 |
|
strings.json
CHANGED
@@ -31,7 +31,8 @@
|
|
31 |
"How may I help you today?",
|
32 |
"Stuck with creating your presentation? Let me help you.",
|
33 |
"Looks like you have a looming deadline. Can I help you get started with your slide deck?",
|
34 |
-
"Hello! What topic do you have on your mind today?"
|
|
|
35 |
],
|
36 |
"chat_placeholder": "Write the topic or instructions here",
|
37 |
"like_feedback": "If you like SlideDeck AI, please consider leaving a heart ❤\uFE0F on the [Hugging Face Space](https://huggingface.co/spaces/barunsaha/slide-deck-ai/) or a star ⭐ on [GitHub](https://github.com/barun-saha/slide-deck-ai). Your [feedback](https://forms.gle/JECFBGhjvSj7moBx9) is appreciated."
|
|
|
31 |
"How may I help you today?",
|
32 |
"Stuck with creating your presentation? Let me help you.",
|
33 |
"Looks like you have a looming deadline. Can I help you get started with your slide deck?",
|
34 |
+
"Hello! What topic do you have on your mind today?",
|
35 |
+
"Did you know that SlideDeck AI supports eight LLMs that are free to use and generate contents in different styles? Try them out from the dropdown list."
|
36 |
],
|
37 |
"chat_placeholder": "Write the topic or instructions here",
|
38 |
"like_feedback": "If you like SlideDeck AI, please consider leaving a heart ❤\uFE0F on the [Hugging Face Space](https://huggingface.co/spaces/barunsaha/slide-deck-ai/) or a star ⭐ on [GitHub](https://github.com/barun-saha/slide-deck-ai). Your [feedback](https://forms.gle/JECFBGhjvSj7moBx9) is appreciated."
|