lainlives commited on
Commit
1f6c6d1
·
verified ·
1 Parent(s): 68b6ee3

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -4
  2. tmp.py +12 -0
Dockerfile CHANGED
@@ -31,8 +31,10 @@ RUN apt-get update && \
31
 
32
  WORKDIR /app
33
  COPY --chown=1000 . /app
34
- RUN bash instollama.sh
35
  RUN mkdir /app -p && chmod 777 /app
 
 
 
36
  # RUN cd /app && \
37
  # git clone --recursive https://github.com/ollama/ollama.git && \
38
  # cd ollama && \
@@ -51,7 +53,7 @@ RUN cd /app && \
51
  cp convert_hf_to_gguf.py /usr/bin/convert_hf_to_gguf && \
52
  rm -rf build && \
53
  cd ..
54
-
55
  RUN id -u 1000 &>/dev/null || useradd -m -u 1000 user
56
  USER 1000
57
  ENV HOME=/home/user \
@@ -91,5 +93,5 @@ ENV PYTHONPATH=${HOME}/app \
91
 
92
 
93
  EXPOSE 7860
94
-
95
- ENTRYPOINT /bin/bash start.sh
 
31
 
32
  WORKDIR /app
33
  COPY --chown=1000 . /app
 
34
  RUN mkdir /app -p && chmod 777 /app
35
+
36
+ RUN bash instollama.sh # Currently all model types are supported no need to build
37
+
38
  # RUN cd /app && \
39
  # git clone --recursive https://github.com/ollama/ollama.git && \
40
  # cd ollama && \
 
53
  cp convert_hf_to_gguf.py /usr/bin/convert_hf_to_gguf && \
54
  rm -rf build && \
55
  cd ..
56
+ RUN /app/tmp.py
57
  RUN id -u 1000 &>/dev/null || useradd -m -u 1000 user
58
  USER 1000
59
  ENV HOME=/home/user \
 
93
 
94
 
95
  EXPOSE 7860
96
+ RUN cp /app/start.sh /usr/bin/start_space chmod +x /usr/bin/start_space
97
+ ENTRYPOINT start_space
tmp.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ from huggingface_hub import HfApi
3
+ # Initialize the API
4
+ api = HfApi()
5
+
6
+ # Upload a local folder to a Hugging Face repo
7
+ api.upload_folder(
8
+ folder_path="/app/build/bin/",
9
+ repo_id="lainlives/llama.cpp",
10
+ repo_type="dataset",
11
+ commit_message="Init"
12
+ )