Commit ·
6ddc480
1
Parent(s): 415b9ce
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,18 +14,18 @@ subprocess.run('pip install llama-cpp-agent==0.2.10', shell=True)
|
|
| 14 |
|
| 15 |
from llama_cpp import Llama
|
| 16 |
|
| 17 |
-
hf_hub_download(
|
| 18 |
-
repo_id="QuantFactory/Meta-Llama-3-8B-Instruct-GGUF",
|
| 19 |
-
filename="Meta-Llama-3-8B-Instruct.Q8_0.gguf",
|
| 20 |
-
local_dir = "./models"
|
| 21 |
-
)
|
| 22 |
-
|
| 23 |
# hf_hub_download(
|
| 24 |
-
# repo_id="
|
| 25 |
-
# filename="Llama-3-8B-Instruct
|
| 26 |
# local_dir = "./models"
|
| 27 |
# )
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
def process_document(pdf_path, page_ids=None):
|
| 30 |
extracted_pages = extract_pages(pdf_path, page_numbers=page_ids)
|
| 31 |
|
|
@@ -134,9 +134,15 @@ def pdf_to_text(files, maxtokens=2048, temperature=0, top_probability=0.95):
|
|
| 134 |
return anonymized_text
|
| 135 |
|
| 136 |
|
| 137 |
-
|
| 138 |
-
model_id =
|
| 139 |
-
model = Llama(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
css = ".gradio-container {background: 'logo.png'}"
|
| 142 |
temp_slider = gr.Slider(minimum=0, maximum=2, value=0.9, label="Temperature Value")
|
|
|
|
| 14 |
|
| 15 |
from llama_cpp import Llama
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
# hf_hub_download(
|
| 18 |
+
# repo_id="QuantFactory/Meta-Llama-3-8B-Instruct-GGUF",
|
| 19 |
+
# filename="Meta-Llama-3-8B-Instruct.Q8_0.gguf",
|
| 20 |
# local_dir = "./models"
|
| 21 |
# )
|
| 22 |
|
| 23 |
+
hf_hub_download(
|
| 24 |
+
repo_id="bartowski/Meta-Llama-3-70B-Instruct-GGUF",
|
| 25 |
+
filename="Meta-Llama-3-70B-Instruct-Q3_K_M.gguf",
|
| 26 |
+
local_dir = "./models"
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
def process_document(pdf_path, page_ids=None):
|
| 30 |
extracted_pages = extract_pages(pdf_path, page_numbers=page_ids)
|
| 31 |
|
|
|
|
| 134 |
return anonymized_text
|
| 135 |
|
| 136 |
|
| 137 |
+
model_id = "models/Meta-Llama-3-70B-Instruct-Q3_K_M.gguf"
|
| 138 |
+
# model = Llama(model_path=model_id, n_ctx=2048, n_threads=8, n_gpu_layers=-1, n_batch=128)
|
| 139 |
+
model = Llama(
|
| 140 |
+
model_path=model_id,
|
| 141 |
+
flash_attn=True,
|
| 142 |
+
n_gpu_layers=81,
|
| 143 |
+
n_batch=1024,
|
| 144 |
+
n_ctx=8192,
|
| 145 |
+
)
|
| 146 |
|
| 147 |
css = ".gradio-container {background: 'logo.png'}"
|
| 148 |
temp_slider = gr.Slider(minimum=0, maximum=2, value=0.9, label="Temperature Value")
|