nomic-ai / gpt4all

GPT4All: Run Local LLMs on Any Device. Open-source and available for commercial use.
https://nomic.ai/gpt4all
MIT License
70.84k stars 7.71k forks source link

GPT4AllEmbeddings initialization fails in AWS CodeBuild environment due to GitHub access restrictions #3196

Open ytpf23 opened 6 days ago

ytpf23 commented 6 days ago

Bug Report GPT4AllEmbeddings initialization fails in AWS CodeBuild environment due to GitHub access restrictions, despite working locally with latest dependencies. Steps to Reproduce

Use GPT4AllEmbeddings with latest langchain and gpt4all versions:

def get_gpt4_embeddings() -> GPT4AllEmbeddings:
    logger.info("Initializing GPT4AllEmbeddings")
    model_path = "/code/models/"

    return GPT4AllEmbeddings(
        model="all-MiniLM-L6-v2.gguf2.f16.gguf",
        gpt4all_kwargs={
            'model_path': model_path,
            'allow_download': False, 
        }
    )

Despite allow_download=False and model present in path, initialization fails in AWS CodeBuild Error shows GitHub access restriction:

CopyValidationError: 1 validation error for GPT4AllEmbeddings root Expecting value: line 2 column 1 (char 2) (type=value_error.jsondecode; msg=Expecting value; doc= <!DOCTYPE html>

Forbidden · GitHub ... Expected Behavior GPT4AllEmbeddings should initialize using local model file without requiring GitHub access when model is present and allow_download=False. Your Environment Python version: 3.9.18-bookworm GPT4All version: 2.8.2 Langchain version: 0.3.7 Langchain-community version: 0.3.7 Environment: AWS CodeBuild Model file: Present at /code/models/all-MiniLM-L6-v2.gguf2.f16.gguf Note: Setup works correctly in local environment with identical dependencies and configuration