Spaces:
Runtime error
Runtime error
Update stri.py
Browse files
stri.py
CHANGED
@@ -74,12 +74,14 @@ if st.button('Сгенерировать'):
|
|
74 |
|
75 |
num_books_per_page = st.selectbox("Количество книг на странице:", [3, 5, 10], index=0)
|
76 |
|
|
|
|
|
77 |
for i in indices[:num_books_per_page]:
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
image_url = books['image_url'][i]
|
82 |
response = requests.get(image_url)
|
83 |
image = Image.open(BytesIO(response.content))
|
84 |
-
|
85 |
-
|
|
|
74 |
|
75 |
num_books_per_page = st.selectbox("Количество книг на странице:", [3, 5, 10], index=0)
|
76 |
|
77 |
+
cols = st.beta_columns(2) # Создание двух столбцов для размещения информации и изображения
|
78 |
+
|
79 |
for i in indices[:num_books_per_page]:
|
80 |
+
cols[0].write("## " + books['title'][i])
|
81 |
+
cols[0].write("**Автор:**", books['author'][i])
|
82 |
+
cols[0].write("**Аннотация:**", books['annotation'][i])
|
83 |
image_url = books['image_url'][i]
|
84 |
response = requests.get(image_url)
|
85 |
image = Image.open(BytesIO(response.content))
|
86 |
+
cols[1].image(image)
|
87 |
+
cols[0].write("---")
|