prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Files not found while running telegram bot 
  I run telegram bot interface (copy-paste from readme)
  ```
  python -m deeppavlov.deep interactbot deeppavlov/configs/go_bot/gobot_dstc2.json -t TELEGRAM_TOKEN
  ```
  
  But the error is given:
  
  ```  
  File "/home/ubuntu/work/ipavlov/DeepPavlov/deeppavlov/core/common/file.py", line 22, in read_json
      with open(fpath) as fin:
  FileNotFoundError: [Errno 2] No such file or directory: '../telegram_utils/models_info.json' 
  ```
  
  All files have been downloaded and successfully used in training.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `telegram_utils/telegram_ui.py`
  Content:
  ```
  1 """
  2 Copyright 2017 Neural Networks and Deep Learning lab, MIPT
  3 
  4 Licensed under the Apache License, Version 2.0 (the "License");
  5 you may not use this file except in compliance with the License.
  6 You may obtain a copy of the License at
  7 
  8     http://www.apache.org/licenses/LICENSE-2.0
  9 
  10 Unless required by applicable law or agreed to in writing, software
  11 distributed under the License is distributed on an "AS IS" BASIS,
  12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 See the License for the specific language governing permissions and
  14 limitations under the License.
  15 """
  16 import telebot
  17 
  18 from deeppavlov.core.common.file import read_json
  19 from deeppavlov.core.commands.infer import build_model_from_config
  20 
  21 
  22 def init_bot_for_model(token, model):
  23     bot = telebot.TeleBot(token)
  24 
  25     model_name = type(model).__name__
  26     models_info = read_json('../telegram_utils/models_info.json')
  27     model_info = models_info[model_name] if model_name in models_info else models_info['@default']
  28 
  29     @bot.message_handler(commands=['start'])
  30     def send_start_message(message):
  31         chat_id = message.chat.id
  32         out_message = model_info['start_message']
  33         if hasattr(model, 'reset'):
  34             model.reset()
  35         bot.send_message(chat_id, out_message)
  36 
  37     @bot.message_handler(commands=['help'])
  38     def send_help_message(message):
  39         chat_id = message.chat.id
  40         out_message = model_info['help_message']
  41         bot.send_message(chat_id, out_message)
  42 
  43     @bot.message_handler()
  44     def handle_inference(message):
  45         chat_id = message.chat.id
  46         context = message.text
  47 
  48         pred = model([context])
  49         reply_message = str(pred[0])
  50         bot.send_message(chat_id, reply_message)
  51 
  52     bot.polling()
  53 
  54 
  55 def interact_model_by_telegram(config_path, token):
  56     config = read_json(config_path)
  57     model = build_model_from_config(config)
  58     init_bot_for_model(token, model)
  59
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/telegram_utils/telegram_ui.py b/telegram_utils/telegram_ui.py
  --- a/telegram_utils/telegram_ui.py
  +++ b/telegram_utils/telegram_ui.py
  @@ -13,6 +13,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
   """
  +from pathlib import Path
  +
   import telebot
   
   from deeppavlov.core.common.file import read_json
  @@ -23,7 +25,8 @@
       bot = telebot.TeleBot(token)
   
       model_name = type(model).__name__
  -    models_info = read_json('../telegram_utils/models_info.json')
  +    config_path = Path(__file__).parent / 'models_info.json'
  +    models_info = read_json(str(config_path))
       model_info = models_info[model_name] if model_name in models_info else models_info['@default']
   
       @bot.message_handler(commands=['start'])
  
verification_info: {"golden_diff": "diff --git a/telegram_utils/telegram_ui.py b/telegram_utils/telegram_ui.py\n--- a/telegram_utils/telegram_ui.py\n+++ b/telegram_utils/telegram_ui.py\n@@ -13,6 +13,8 @@\n See the License for the specific language governing permissions and\n limitations under the License.\n \"\"\"\n+from pathlib import Path\n+\n import telebot\n \n from deeppavlov.core.common.file import read_json\n@@ -23,7 +25,8 @@\n     bot = telebot.TeleBot(token)\n \n     model_name = type(model).__name__\n-    models_info = read_json('../telegram_utils/models_info.json')\n+    config_path = Path(__file__).parent / 'models_info.json'\n+    models_info = read_json(str(config_path))\n     model_info = models_info[model_name] if model_name in models_info else models_info['@default']\n \n     @bot.message_handler(commands=['start'])\n", "issue": "Files not found while running telegram bot \nI run telegram bot interface (copy-paste from readme)\r\n```\r\npython -m deeppavlov.deep interactbot deeppavlov/configs/go_bot/gobot_dstc2.json -t TELEGRAM_TOKEN\r\n```\r\n\r\nBut the error is given:\r\n\r\n```  \r\nFile \"/home/ubuntu/work/ipavlov/DeepPavlov/deeppavlov/core/common/file.py\", line 22, in read_json\r\n    with open(fpath) as fin:\r\nFileNotFoundError: [Errno 2] No such file or directory: '../telegram_utils/models_info.json' \r\n```\r\n\r\nAll files have been downloaded and successfully used in training.\n", "before_files": [{"content": "\"\"\"\nCopyright 2017 Neural Networks and Deep Learning lab, MIPT\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\nimport telebot\n\nfrom deeppavlov.core.common.file import read_json\nfrom deeppavlov.core.commands.infer import build_model_from_config\n\n\ndef init_bot_for_model(token, model):\n    bot = telebot.TeleBot(token)\n\n    model_name = type(model).__name__\n    models_info = read_json('../telegram_utils/models_info.json')\n    model_info = models_info[model_name] if model_name in models_info else models_info['@default']\n\n    @bot.message_handler(commands=['start'])\n    def send_start_message(message):\n        chat_id = message.chat.id\n        out_message = model_info['start_message']\n        if hasattr(model, 'reset'):\n            model.reset()\n        bot.send_message(chat_id, out_message)\n\n    @bot.message_handler(commands=['help'])\n    def send_help_message(message):\n        chat_id = message.chat.id\n        out_message = model_info['help_message']\n        bot.send_message(chat_id, out_message)\n\n    @bot.message_handler()\n    def handle_inference(message):\n        chat_id = message.chat.id\n        context = message.text\n\n        pred = model([context])\n        reply_message = str(pred[0])\n        bot.send_message(chat_id, reply_message)\n\n    bot.polling()\n\n\ndef interact_model_by_telegram(config_path, token):\n    config = read_json(config_path)\n    model = build_model_from_config(config)\n    init_bot_for_model(token, model)\n", "path": "telegram_utils/telegram_ui.py"}], "after_files": [{"content": "\"\"\"\nCopyright 2017 Neural Networks and Deep Learning lab, MIPT\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\nfrom pathlib import Path\n\nimport telebot\n\nfrom deeppavlov.core.common.file import read_json\nfrom deeppavlov.core.commands.infer import build_model_from_config\n\n\ndef init_bot_for_model(token, model):\n    bot = telebot.TeleBot(token)\n\n    model_name = type(model).__name__\n    config_path = Path(__file__).parent / 'models_info.json'\n    models_info = read_json(str(config_path))\n    model_info = models_info[model_name] if model_name in models_info else models_info['@default']\n\n    @bot.message_handler(commands=['start'])\n    def send_start_message(message):\n        chat_id = message.chat.id\n        out_message = model_info['start_message']\n        if hasattr(model, 'reset'):\n            model.reset()\n        bot.send_message(chat_id, out_message)\n\n    @bot.message_handler(commands=['help'])\n    def send_help_message(message):\n        chat_id = message.chat.id\n        out_message = model_info['help_message']\n        bot.send_message(chat_id, out_message)\n\n    @bot.message_handler()\n    def handle_inference(message):\n        chat_id = message.chat.id\n        context = message.text\n\n        pred = model([context])\n        reply_message = str(pred[0])\n        bot.send_message(chat_id, reply_message)\n\n    bot.polling()\n\n\ndef interact_model_by_telegram(config_path, token):\n    config = read_json(config_path)\n    model = build_model_from_config(config)\n    init_bot_for_model(token, model)\n", "path": "telegram_utils/telegram_ui.py"}]}