nesterus commited on
Commit
2c65b13
·
1 Parent(s): ddcd8a1

changed README according to space configuration requirements

Browse files
Files changed (1) hide show
  1. README.md +10 -136
README.md CHANGED
@@ -1,137 +1,11 @@
1
-
2
- # README
3
-
4
- ## Overview
5
-
6
- This project generates a PowerPoint presentation based on user-provided descriptions. It leverages language models to generate text content and an image generation API to create images for the slides. The architecture is modular, allowing for easy extension and customization of the text and image generation components.
7
-
8
- ## How to Use
9
-
10
- ### Prerequisites
11
-
12
- - Python 3.10 or higher
13
- - Required Python packages (listed in `requirements.txt`)
14
-
15
- ### Setup
16
-
17
- 1. **Clone the repository**:
18
-
19
- ```bash
20
- git clone --recurse-submodules https://github.com/ai-forever/presentations.git
21
- cd presentations
22
- ```
23
-
24
- 2. **Install dependencies**:
25
-
26
- ```bash
27
- pip install -r requirements.txt
28
- ```
29
-
30
- 3. **Create a .env file** in the root directory with GigaChat credentials:
31
-
32
- Here is the [documentation](https://developers.sber.ru/portal/products/gigachat-api) on how to get access token.
33
-
34
- ```plaintext
35
- AUTH_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
36
- COOKIE=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
37
- ```
38
-
39
-
40
- 4. **Run the FastAPI server** for the image generation API:
41
-
42
- ```bash
43
- python src/kandinsky.py
44
- ```
45
-
46
- ### Running the Script
47
-
48
- To generate a presentation, use the following command:
49
-
50
- ```bash
51
- python main.py -d "Description of the presentation" -l 'en'
52
- ```
53
-
54
- This will generate a presentation based on the provided description and save it in the `logs` directory with a timestamp.
55
-
56
- ## Examples
57
-
58
- ```bash
59
- python main.py -d "Сгенерируй презентацию про планеты солнечной системы" -l 'ru'
60
- ```
61
-
62
- ```bash
63
- python main.py -d "Generate presentation about planets of Solar system" -l 'en'
64
- ```
65
-
66
- This command will create a presentation on the topic "Planets of the Solar System" using the configured text and image generation functions.
67
-
68
- ## Architecture
69
-
70
- ### Main Components
71
-
72
- 1. **main.py**: The entry point of the application. It parses command-line arguments, initializes required components, and orchestrates the presentation generation process.
73
-
74
- 2. **Font Class (src/font.py)**: Manages fonts used in the presentation. It can select a random font with basic and bold styles and provide paths to various font styles (basic, bold, italic, and italic bold).
75
-
76
- 3. **Presentation Generation Functions (src/constructor.py)**: Functions that generate different types of slides in the presentation. They handle the layout, font settings, and placement of text and images.
77
-
78
- 4. **Text Generation (src/gigachat.py)**: Contains the `giga_generate` function, which generates text based on a given prompt.
79
-
80
- 5. **Image Generation (src/kandinsky.py)**: Includes the `api_k31_generate` function, which generates images based on a prompt using an external API. Additionally, it provides a FastAPI server for the image generation API.
81
-
82
- 6. **Prompt Configuration (src/prompt_configs.py)**: Defines the structure of prompts used for generating titles, text, images, and backgrounds for slides.
83
-
84
- ### How It Works
85
-
86
- 1. **Initialization**:
87
- - `main.py` parses command-line arguments to get the presentation description.
88
- - It initializes the `Font` class with the directory containing font files and sets a random font.
89
-
90
- 2. **Prompt Configuration**:
91
- - The `ru_gigachat_config` defines the structure and content of prompts used for generating slide components (titles, text, images, backgrounds).
92
-
93
- 3. **Text and Image Generation**:
94
- - The `giga_generate` function generates text based on the provided description.
95
- - The `api_k31_generate` function generates images based on prompts using the FastAPI server.
96
-
97
- 4. **Slide Generation**:
98
- - The `generate_presentation` function orchestrates the creation of slides by calling appropriate functions to generate text and images, and then formats them into slides.
99
-
100
- ## Extending the Project
101
-
102
- ### Adding New Font Styles
103
-
104
- To add new font styles, place the font files in the `fonts` directory and update the `Font` class if necessary to recognize the new styles.
105
-
106
- ### Changing Text Generation
107
-
108
- To use a different text generation function, replace the `giga_generate` function from `src/gigachat.py` or add a new function and update the call in `main.py`.
109
-
110
- ### Changing Image Generation
111
-
112
- To use a different image generation API, modify the `api_k31_generate` function in `src/kandinsky.py` or add a new function and update the call in `main.py`.
113
-
114
- ## Acknowledgements
115
-
116
- This project leverages the `python-pptx` library for PowerPoint generation, PIL for image processing, and other Python libraries for various functionalities. The text and image generation models are based on external APIs and language models.
117
-
118
  ---
119
-
120
- Feel free to reach out with any questions or suggestions!
121
-
122
- ## Authors
123
-
124
- + Said Azizov: [Github](https://github.com/stazizov), [Blog](https://t.me/said_azizau)
125
-
126
- ## Citation
127
-
128
- ```
129
- @misc{arkhipkin2023kandinsky,
130
- title={Kandinsky 3.0 Technical Report},
131
- author={Vladimir Arkhipkin and Andrei Filatov and Viacheslav Vasilev and Anastasia Maltseva and Said Azizov and Igor Pavlov and Julia Agafonova and Andrey Kuznetsov and Denis Dimitrov},
132
- year={2023},
133
- eprint={2312.03511},
134
- archivePrefix={arXiv},
135
- primaryClass={cs.CV}
136
- }
137
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Presentation Generation
3
+ emoji: 🏃
4
+ colorFrom: gray
5
+ colorTo: purple
6
+ sdk: gradio
7
+ sdk_version: 4.42.0
8
+ app_file: app.py
9
+ pinned: false
10
+ license: apache-2.0
11
+ ---