Skip to content

Commit

Permalink
v1.2.3
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Jul 4, 2024
1 parent c9ae136 commit fcd3950
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ RUN apt-get install -y python3.11-venv
RUN apt-get install -y python3.11-dev
RUN apt-get install -y python3-pip

ENV CMAKE_ARGS="-DLLAMA_CUDA=on"

RUN \
python3 -m pip install -r requirements.txt && rm -rf ~/.cache && rm requirements.txt

RUN python3 -m pip uninstall -y llama-cpp-python \
&& python3 -m pip install llama-cpp-python \
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu122

WORKDIR /app/lib
ENTRYPOINT ["python3", "main.py"]

Expand Down
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
See [the nextcloud admin docs](https://docs.nextcloud.com/server/latest/admin_manual/ai/index.html) for more information.
]]></description>
<version>1.2.2</version>
<version>1.2.3</version>
<licence>MIT</licence>
<author mail="mklehr@gmx.net" homepage="https://github.com/marcelklehr">Marcel Klehr</author>
<author mail="bigcat88@icloud.com" homepage="https://github.com/bigcat88">Alexander Piskun</author>
Expand All @@ -25,7 +25,7 @@ See [the nextcloud admin docs](https://docs.nextcloud.com/server/latest/admin_ma
<docker-install>
<registry>ghcr.io</registry>
<image>nextcloud/llm2</image>
<image-tag>1.2.2</image-tag>
<image-tag>1.2.3</image-tag>
</docker-install>
<scopes>
<value>AI_PROVIDERS</value>
Expand Down
7 changes: 6 additions & 1 deletion lib/chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,16 @@ def generate_llm_chain(file_name):
n_ctx=model_config['gpt4all_config']["n_predict"],
max_tokens=model_config["gpt4all_config"]["max_tokens"],
stop=model_config["gpt4all_config"]["stop"],
echo=True
)
print(f'Using: {config["llama"]["model_kwargs"]["device"]}', flush=True)
except Exception as gpu_error:
try:
llm = LlamaCpp(model_path=path, device="cpu", max_tokens=4096)
llm = LlamaCpp(model_path=path, device="cpu",
n_ctx=model_config['gpt4all_config']["n_predict"],
max_tokens=model_config["gpt4all_config"]["max_tokens"],
stop=model_config["gpt4all_config"]["stop"],
echo=True)
print("Using: CPU", flush=True)
except Exception as cpu_error:
raise RuntimeError(f"Error: Failed to initialize the LLM model on both GPU and CPU.", f"{cpu_error}") from cpu_error
Expand Down

0 comments on commit fcd3950

Please sign in to comment.