Commit ·
e6dfdfc
1
Parent(s): 7f9350e
Update app.py
Browse files
app.py
CHANGED
|
@@ -138,19 +138,19 @@ def pdf_to_text(files, prompt="", maxtokens=600, temperature=1.2, top_probabilit
|
|
| 138 |
zipf.write(file, os.path.basename(file))
|
| 139 |
return 'anonymized_reports'
|
| 140 |
|
| 141 |
-
model_id = "Meta-Llama-3-8B-Instruct.Q5_K_M.gguf"
|
| 142 |
-
model = Llama(model_path=model_id, n_ctx=2048, n_threads=8, n_gpu_layers=32, n_batch=64)
|
| 143 |
|
| 144 |
# model = GPT4All("Meta-Llama-3-8B-Instruct.Q4_0.gguf", n_threads=8, device='gpu')
|
| 145 |
# model.chat_session()
|
| 146 |
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
|
| 155 |
temp_slider = gr.Slider(minimum=0, maximum=2, value=0.2, label="Temperature Value")
|
| 156 |
prob_slider = gr.Slider(minimum=0, maximum=1, value=0.95, label="Max Probability Value")
|
|
|
|
| 138 |
zipf.write(file, os.path.basename(file))
|
| 139 |
return 'anonymized_reports'
|
| 140 |
|
| 141 |
+
# model_id = "Meta-Llama-3-8B-Instruct.Q5_K_M.gguf"
|
| 142 |
+
# model = Llama(model_path=model_id, n_ctx=2048, n_threads=8, n_gpu_layers=32, n_batch=64)
|
| 143 |
|
| 144 |
# model = GPT4All("Meta-Llama-3-8B-Instruct.Q4_0.gguf", n_threads=8, device='gpu')
|
| 145 |
# model.chat_session()
|
| 146 |
|
| 147 |
+
model_id = "D:/llama/meta-llama/Meta-Llama-3-8B-Instruct"
|
| 148 |
+
model = transformers.pipeline(
|
| 149 |
+
"text-generation",
|
| 150 |
+
model=model_id,
|
| 151 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
| 152 |
+
device="cpu",
|
| 153 |
+
)
|
| 154 |
|
| 155 |
temp_slider = gr.Slider(minimum=0, maximum=2, value=0.2, label="Temperature Value")
|
| 156 |
prob_slider = gr.Slider(minimum=0, maximum=1, value=0.95, label="Max Probability Value")
|