adowu commited on
Commit
f02a3ed
·
verified ·
1 Parent(s): ab2b8cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -107,9 +107,9 @@ def explain_improvement(
107
  ):
108
  llm = get_llm()
109
 
110
- chat_session = llm.start_chat() # Usunięto argument 'messages'
111
 
112
- response = chat_session.send_message( # Dodano wiadomości do send_message()
113
  f"""Następujący prompt:
114
  ---
115
  {prompt}
@@ -145,9 +145,8 @@ def improve_prompt(
145
  metaprompt_template = metaprompts_dict[metaprompt].template
146
 
147
  llm = get_llm()
148
- chat_session = llm.start_chat() # Usunięto argument 'messages'
149
 
150
- # Przesłanie system_message do send_message()
151
  chat_session.send_message(system_message)
152
 
153
  explanation_history += [
@@ -169,7 +168,6 @@ def improve_prompt(
169
  for key, value in input_message.items():
170
  input_str += f"{key}: {value}\n"
171
 
172
- # Przesłanie metaprompt_template i input_str do send_message()
173
  response = chat_session.send_message(metaprompt_template + "\n" + input_str)
174
 
175
  explanation_history[-1][1] += response.text
@@ -198,10 +196,9 @@ def robustly_improve_prompt(*args, **kwargs):
198
 
199
 
200
  with gr.Blocks(title="Nauczyciel Promptów", theme=gr.themes.Soft()) as gradio_app:
201
- gr.Markdown(
202
- "<center><h1>🤖 <font size = '7'>Nauczyciel Promptów</font> - Pomocnik w pisaniu lepszych promptów! 📝✨ </h1></center>",
203
- unsafe_allow_html=True,
204
- )
205
  with gr.Accordion("ℹ️ Co to są prompty?", open=True):
206
  gr.Markdown(
207
  """
 
107
  ):
108
  llm = get_llm()
109
 
110
+ chat_session = llm.start_chat()
111
 
112
+ response = chat_session.send_message(
113
  f"""Następujący prompt:
114
  ---
115
  {prompt}
 
145
  metaprompt_template = metaprompts_dict[metaprompt].template
146
 
147
  llm = get_llm()
148
+ chat_session = llm.start_chat()
149
 
 
150
  chat_session.send_message(system_message)
151
 
152
  explanation_history += [
 
168
  for key, value in input_message.items():
169
  input_str += f"{key}: {value}\n"
170
 
 
171
  response = chat_session.send_message(metaprompt_template + "\n" + input_str)
172
 
173
  explanation_history[-1][1] += response.text
 
196
 
197
 
198
  with gr.Blocks(title="Nauczyciel Promptów", theme=gr.themes.Soft()) as gradio_app:
199
+ # Zastosowanie gr.HTML do wyświetlenia HTML
200
+ gr.HTML(
201
+ "<center><h1>🤖 <font size = '7'>Nauczyciel Promptów</font> - Pomocnik w pisaniu lepszych promptów! 📝✨ </h1></center>")
 
202
  with gr.Accordion("ℹ️ Co to są prompty?", open=True):
203
  gr.Markdown(
204
  """