Spaces:
Runtime error
Runtime error
Yash Sachdeva
commited on
Commit
•
2d5d217
1
Parent(s):
c6bf030
llm download
Browse files- Dockerfile +3 -2
- question_paper.py +5 -0
Dockerfile
CHANGED
@@ -16,9 +16,10 @@ RUN pip install torch
|
|
16 |
|
17 |
RUN pip install accelerate
|
18 |
|
19 |
-
|
20 |
-
RUN
|
21 |
|
|
|
22 |
# Install requirements.txt
|
23 |
RUN pip install --no-cache-dir --upgrade -r /requirements.txt
|
24 |
|
|
|
16 |
|
17 |
RUN pip install accelerate
|
18 |
|
19 |
+
# Install hugging face hub to download llama2 model
|
20 |
+
RUN pip install --upgrade huggingface_hub
|
21 |
|
22 |
+
RUN CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install 'llama-cpp-python[server]' --upgrade --force-reinstall --no-cache-dir
|
23 |
# Install requirements.txt
|
24 |
RUN pip install --no-cache-dir --upgrade -r /requirements.txt
|
25 |
|
question_paper.py
CHANGED
@@ -8,8 +8,13 @@ from transformers import AutoTokenizer
|
|
8 |
|
9 |
from llama_cpp import Llama
|
10 |
|
|
|
|
|
11 |
# Load the model
|
12 |
|
|
|
|
|
|
|
13 |
app = FastAPI()
|
14 |
@app.get("/")
|
15 |
def llama():
|
|
|
8 |
|
9 |
from llama_cpp import Llama
|
10 |
|
11 |
+
from huggingface_hub import hf_hub_download
|
12 |
+
|
13 |
# Load the model
|
14 |
|
15 |
+
hf_hub_download(repo_id="bevangelista/Llama-2-7b-chat-hf-GGUF-Q4_K_M", filename="Llama-2-7b-chat-hf-GGUF-Q4_K_M.gguf")
|
16 |
+
|
17 |
+
|
18 |
app = FastAPI()
|
19 |
@app.get("/")
|
20 |
def llama():
|