OpenAI-sublime-text: [OpenAI completion.plugins.load_model] ERROR: Error reading: System cannot find the specified path. (os error 3)

The problem is here for RC5 plugin:

def get_cache_path(view: View) -> str:
    path = cache_path() + '/OpenAI completion/'
    
    logger.debug('view %s', view)
    ai_assistant = view.settings().get(
        'ai_assistant',
        None,
    )
    logger.debug('ai_assistant %s', ai_assistant)
    if ai_assistant:
        path = ai_assistant.get(  # type: ignore
            'cache_prefix',
            cache_path(),
        )
    logger.debug('path: %s', path)
    return path

Add this to fix that:

import os

path = cache_path() + '/OpenAI completion/'
if not os.path.exists(path):
        os.makedirs(path)

But after that you have to create the cache file with defaults settings if it’s not exist otherwise it will throw error about non-existant file.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I’m so sorry, that was totally my fault, I installed and used as default v2rayN (for youtube purpose only) with system proxy set. It worked with your old 4.2 version somehow, but now that was a problem even if ollama is running and curl commands worked. So I switched v2rayN from system proxy to VPN mode and now Sublime gets the response from ollama

I’ve made it, now the errors shows in an extended way. Since all the changes was made on the rust side please call Package Control: Satisfy Packages/Libraries and then try to use ollama