Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,24 +10,26 @@ import subprocess
|
|
| 10 |
from huggingface_hub import hf_hub_download
|
| 11 |
from llama_cpp import Llama
|
| 12 |
|
|
|
|
|
|
|
| 13 |
# hf_hub_download(
|
| 14 |
# repo_id="QuantFactory/Meta-Llama-3-8B-Instruct-GGUF",
|
| 15 |
# filename="Meta-Llama-3-8B-Instruct.Q8_0.gguf",
|
| 16 |
# local_dir = "./models"
|
| 17 |
# )
|
| 18 |
|
| 19 |
-
# hf_hub_download(
|
| 20 |
-
# repo_id="bartowski/Meta-Llama-3-70B-Instruct-GGUF",
|
| 21 |
-
# filename="Meta-Llama-3-70B-Instruct-Q3_K_M.gguf",
|
| 22 |
-
# local_dir = "./models"
|
| 23 |
-
# )
|
| 24 |
-
|
| 25 |
hf_hub_download(
|
| 26 |
-
repo_id="
|
| 27 |
-
filename=
|
| 28 |
local_dir = "./models"
|
| 29 |
)
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
def process_document(pdf_path):
|
| 32 |
extracted_pages = extract_pages(pdf_path)
|
| 33 |
page2content = {}
|
|
@@ -99,7 +101,7 @@ def pdf_to_text(cv_file, prompt, maxtokens=2048, temperature=0, top_probability=
|
|
| 99 |
for page_id in page2content:
|
| 100 |
cv_text += page2content[page_id] + ' '
|
| 101 |
llm = Llama(
|
| 102 |
-
model_path="models/
|
| 103 |
flash_attn=True,
|
| 104 |
n_gpu_layers=81,
|
| 105 |
n_batch=1024,
|
|
|
|
| 10 |
from huggingface_hub import hf_hub_download
|
| 11 |
from llama_cpp import Llama
|
| 12 |
|
| 13 |
+
model_name = "Meta-Llama-3-70B-Instruct-Q3_K_M.gguf"
|
| 14 |
+
|
| 15 |
# hf_hub_download(
|
| 16 |
# repo_id="QuantFactory/Meta-Llama-3-8B-Instruct-GGUF",
|
| 17 |
# filename="Meta-Llama-3-8B-Instruct.Q8_0.gguf",
|
| 18 |
# local_dir = "./models"
|
| 19 |
# )
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
hf_hub_download(
|
| 22 |
+
repo_id="bartowski/Meta-Llama-3-70B-Instruct-GGUF",
|
| 23 |
+
filename=model_name,
|
| 24 |
local_dir = "./models"
|
| 25 |
)
|
| 26 |
|
| 27 |
+
# hf_hub_download(
|
| 28 |
+
# repo_id="leafspark/Meta-Llama-3.1-405B-Instruct-GGUF",
|
| 29 |
+
# filename="Llama-3.1-405B-Instruct.Q2_K.gguf",
|
| 30 |
+
# local_dir = "./models"
|
| 31 |
+
# )
|
| 32 |
+
|
| 33 |
def process_document(pdf_path):
|
| 34 |
extracted_pages = extract_pages(pdf_path)
|
| 35 |
page2content = {}
|
|
|
|
| 101 |
for page_id in page2content:
|
| 102 |
cv_text += page2content[page_id] + ' '
|
| 103 |
llm = Llama(
|
| 104 |
+
model_path="models/" + model_name,
|
| 105 |
flash_attn=True,
|
| 106 |
n_gpu_layers=81,
|
| 107 |
n_batch=1024,
|