Kremon96 commited on
Commit
2824061
·
verified ·
1 Parent(s): 3eaaefb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -144,10 +144,11 @@ def generate_code_with_context(prompt, files, max_length=1024, temperature=0.7,
144
  return_attention_mask=True
145
  )
146
 
147
- # Генерация с использованием обновленного кода
148
  with torch.no_grad():
149
  generated_ids = model.generate(
150
  inputs.input_ids,
 
151
  max_new_tokens=max_length,
152
  temperature=temperature,
153
  top_p=top_p,
@@ -222,7 +223,7 @@ with gr.Blocks(title="Qwen2.5-Coder-14B with MCP", theme=gr.themes.Soft()) as de
222
  )
223
 
224
  # Добавляем информацию о MCP
225
- with gr.Accordion("🔗 MCP Сервер - Подключение к другим приложениями", open=True):
226
  gr.Markdown("""
227
  **MCP (Model Context Protocol) сервер активирован!**
228
 
 
144
  return_attention_mask=True
145
  )
146
 
147
+ # Генерация с использованием обновленного кода и attention_mask
148
  with torch.no_grad():
149
  generated_ids = model.generate(
150
  inputs.input_ids,
151
+ attention_mask=inputs.attention_mask, # Добавляем attention_mask
152
  max_new_tokens=max_length,
153
  temperature=temperature,
154
  top_p=top_p,
 
223
  )
224
 
225
  # Добавляем информацию о MCP
226
+ with gr.Accordion("🔗 MCP Сервер - Подключение к другим приложениям", open=True):
227
  gr.Markdown("""
228
  **MCP (Model Context Protocol) сервер активирован!**
229