How to run AI on your PC LOCALLY!!! CODE IN THE COMMENTS!!! FRY YOUR PC!!!

Поділитися
Вставка
  • Опубліковано 22 лис 2024

КОМЕНТАРІ • 5

  • @johnperaltaCFA
    @johnperaltaCFA  13 днів тому +3

    from gpt4all import GPT4All
    LOCAL_MODEL_PATH = "C:\\Users\\winnie_the_pooh\\.cache\\gpt4all\\"
    model = GPT4All(
    model_name="Meta-Llama-3-8B-Instruct.Q4_0",
    model_path=LOCAL_MODEL_PATH,
    device="cuda",
    n_threads=8,
    allow_download=False,
    verbose=True
    )
    def generate_local(task):
    print("
    Generating content locally")
    response = model.generate(
    prompt=f"{task}",
    max_tokens=2000
    )
    return response
    prompt = "Say Hi!"
    output = generate_local(prompt)
    output_file = "prompt_and_output.md"
    with open(output_file, "a", encoding="utf-8") as file:
    file.write("# 📝 Prompt:

    ")
    file.write(f"{prompt}

    ")
    file.write("---

    ")
    file.write("## 💬 Response:

    ")
    file.write(output)
    file.write("

    ---
    ")
    print("
    " + "=" * 40)
    print(" 📝 Prompt:
    ")
    print(f"{prompt}")
    print("
    " + "=" * 40)
    print(" 💬 Response:
    ")
    print(output)
    print("
    " + "=" * 40)

  • @jamesperalta35
    @jamesperalta35 13 днів тому +1

    FRY YOUR PC!! FRY YOUR ELECTRICAL BILL!! FRY THE ELECTRICITY GRID!!

    • @johnperaltaCFA
      @johnperaltaCFA  13 днів тому +1

      @jamesperalta35 lol I can define a function now 🤓

  • @johnperaltaCFA
    @johnperaltaCFA  13 днів тому +2

    lol they’re building nuclear power plants for this 😂

    • @jamesperalta35
      @jamesperalta35 13 днів тому +1

      They need to build it in Alberta! Dawson Creek!!