zenivan commited on
Commit
adeef18
·
1 Parent(s): aff28b0
Files changed (1) hide show
  1. app/main_gradio_test_FS_test.py +14 -4
app/main_gradio_test_FS_test.py CHANGED
@@ -17,6 +17,9 @@ from openai.types.responses import ResponseOutputMessage
17
  from app.quotes import quotes
18
  from app.drawings import drawings
19
  import app.prompt
 
 
 
20
 
21
  # Настройка логирования
22
  logging.basicConfig(
@@ -273,7 +276,16 @@ def generate_lesson_plan_interface(
273
  # if chunk.choices and chunk.choices[0].delta and chunk.choices[0].delta.content:
274
  # yield chunk.choices[0].delta.content
275
 
 
 
 
 
 
 
 
 
276
 
 
277
  # Случайный рисунок в блокноте
278
  drawing = random.choice(drawings)
279
  # Текст с подсказкой и рисунком в блокноте
@@ -284,9 +296,7 @@ hint_text = f"""Здесь появится план занятия — запо
284
  </pre>
285
  """
286
 
287
- ########## ИНТЕРФЕЙС
288
  #ТЕМА И СТИЛИ
289
-
290
  ### css привязывать именно так
291
  #theme='earneleh/paris'
292
  theme = gr.themes.Base(
@@ -411,8 +421,8 @@ with gr.Blocks(theme=theme, css_paths=css_path) as demo:
411
 
412
  gr.Markdown(
413
  """
414
- 🙌 А вдруг вы хотите поучаствовать в тестировании глубже?
415
- 👉 [Присоединяйтесь к Telegram-группе](https://t.me/yourgroup)
416
  """
417
  )
418
 
 
17
  from app.quotes import quotes
18
  from app.drawings import drawings
19
  import app.prompt
20
+ import pandas as pd ## сохраняем отзывы
21
+
22
+
23
 
24
  # Настройка логирования
25
  logging.basicConfig(
 
276
  # if chunk.choices and chunk.choices[0].delta and chunk.choices[0].delta.content:
277
  # yield chunk.choices[0].delta.content
278
 
279
+ def save_feedback_fn(comment, rating):
280
+ df = pd.DataFrame([{
281
+ "timestamp": datetime.now().isoformat(),
282
+ "comment": comment,
283
+ "rating": rating
284
+ }])
285
+ df.to_csv("feedback_log.csv", mode='a', header=False, index=False)
286
+
287
 
288
+ ########## ИНТЕРФЕЙС
289
  # Случайный рисунок в блокноте
290
  drawing = random.choice(drawings)
291
  # Текст с подсказкой и рисунком в блокноте
 
296
  </pre>
297
  """
298
 
 
299
  #ТЕМА И СТИЛИ
 
300
  ### css привязывать именно так
301
  #theme='earneleh/paris'
302
  theme = gr.themes.Base(
 
421
 
422
  gr.Markdown(
423
  """
424
+ 🙌 Если вас заинтересовал проект, мы приглашаем
425
+ 👉 [присоединиться к Telegram-группе](https://t.me/yourgroup)
426
  """
427
  )
428