DeepMount00 commited on
Commit
fffccae
·
verified ·
1 Parent(s): 1b33f22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -92,12 +92,12 @@ model.eval()
92
  def generate(
93
  message: str,
94
  chat_history: list[tuple[str, str]],
95
- system_message: str = "",
96
  max_new_tokens: int = 1024,
97
- temperature: float = 0.001,
98
  top_p: float = 1.0,
99
  top_k: int = 50,
100
- repetition_penalty: float = 1.05,
101
  ) -> Iterator[str]:
102
  conversation = [{"role": "system", "content": system_message}]
103
  for user, assistant in chat_history:
@@ -140,7 +140,7 @@ chat_interface = gr.ChatInterface(
140
  fn=generate,
141
  additional_inputs=[
142
  gr.Textbox(
143
- value="",
144
  label="System message",
145
  render=False,
146
  ),
@@ -156,7 +156,7 @@ chat_interface = gr.ChatInterface(
156
  minimum=0,
157
  maximum=4.0,
158
  step=0.1,
159
- value=0.001,
160
  ),
161
  gr.Slider(
162
  label="Top-p (nucleus sampling)",
@@ -177,7 +177,7 @@ chat_interface = gr.ChatInterface(
177
  minimum=1.0,
178
  maximum=2.0,
179
  step=0.05,
180
- value=1.0,
181
  ),
182
  ],
183
  stop_btn=None,
 
92
  def generate(
93
  message: str,
94
  chat_history: list[tuple[str, str]],
95
+ system_message: str = "Sei un assistente utile.",
96
  max_new_tokens: int = 1024,
97
+ temperature: float = 0.2,
98
  top_p: float = 1.0,
99
  top_k: int = 50,
100
+ repetition_penalty: float = 1.1,
101
  ) -> Iterator[str]:
102
  conversation = [{"role": "system", "content": system_message}]
103
  for user, assistant in chat_history:
 
140
  fn=generate,
141
  additional_inputs=[
142
  gr.Textbox(
143
+ value="Sei un assistente utile.",
144
  label="System message",
145
  render=False,
146
  ),
 
156
  minimum=0,
157
  maximum=4.0,
158
  step=0.1,
159
+ value=0.2,
160
  ),
161
  gr.Slider(
162
  label="Top-p (nucleus sampling)",
 
177
  minimum=1.0,
178
  maximum=2.0,
179
  step=0.05,
180
+ value=1.1,
181
  ),
182
  ],
183
  stop_btn=None,