Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 260: fixing cuda not available #271

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, as_completed

import click
import torch
from langchain.docstore.document import Document
from langchain.embeddings import HuggingFaceInstructEmbeddings
from langchain.text_splitter import Language, RecursiveCharacterTextSplitter
Expand Down Expand Up @@ -89,7 +90,7 @@ def split_documents(documents: list[Document]) -> tuple[list[Document], list[Doc
@click.command()
@click.option(
"--device_type",
default="cuda",
default="cuda" if torch.cuda.is_available() else "cpu",
type=click.Choice(
[
"cpu",
Expand Down
4 changes: 2 additions & 2 deletions run_localGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def load_model(device_type, model_id, model_basename=None):
@click.command()
@click.option(
"--device_type",
default="cuda",
default="cuda" if torch.cuda.is_available() else "cpu",
type=click.Choice(
[
"cpu",
Expand Down Expand Up @@ -219,7 +219,7 @@ def main(device_type, show_sources):
# model_id = "TheBloke/orca_mini_3B-GGML"
# model_basename = "orca-mini-3b.ggmlv3.q4_0.bin"

model_id="TheBloke/Llama-2-7B-Chat-GGML"
model_id = "TheBloke/Llama-2-7B-Chat-GGML"
model_basename = "llama-2-7b-chat.ggmlv3.q4_0.bin"

llm = load_model(device_type, model_id=model_id, model_basename=model_basename)
Expand Down