kingabzpro
commited on
Commit
•
b8774c1
1
Parent(s):
7be036b
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
4 |
import torch
|
5 |
|
6 |
MODEL_URL = "kingabzpro/Llama-3.1-8B-Instruct-Mental-Health-Classification"
|
@@ -8,14 +8,9 @@ MODEL_URL = "kingabzpro/Llama-3.1-8B-Instruct-Mental-Health-Classification"
|
|
8 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_URL)
|
9 |
tokenizer.pad_token_id = tokenizer.eos_token_id
|
10 |
|
11 |
-
|
12 |
-
load_in_4bit = True,
|
13 |
-
bnb_4bit_quant_type="nf4",
|
14 |
-
bnb_4bit_compute_dtype=torch.bfloat16,
|
15 |
-
)
|
16 |
|
17 |
model = AutoModelForCausalLM.from_pretrained(MODEL_URL,
|
18 |
-
quantization_config=bnbConfig,
|
19 |
low_cpu_mem_usage=True,
|
20 |
return_dict=True,
|
21 |
torch_dtype=torch.float16,
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
4 |
import torch
|
5 |
|
6 |
MODEL_URL = "kingabzpro/Llama-3.1-8B-Instruct-Mental-Health-Classification"
|
|
|
8 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_URL)
|
9 |
tokenizer.pad_token_id = tokenizer.eos_token_id
|
10 |
|
11 |
+
|
|
|
|
|
|
|
|
|
12 |
|
13 |
model = AutoModelForCausalLM.from_pretrained(MODEL_URL,
|
|
|
14 |
low_cpu_mem_usage=True,
|
15 |
return_dict=True,
|
16 |
torch_dtype=torch.float16,
|