Spaces:
Running
Running
alibidaran
commited on
Commit
•
abe4ee7
1
Parent(s):
13bdf82
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,16 @@ import torch
|
|
4 |
import gradio as gr
|
5 |
import os
|
6 |
import time
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
def print_like_dislike(x: gr.LikeData):
|
10 |
print(x.index, x.value, x.liked)
|
11 |
|
|
|
4 |
import gradio as gr
|
5 |
import os
|
6 |
import time
|
7 |
+
model_id = "alibidaran/Gemma2_Virtual_doctor"
|
8 |
+
bnb_config = BitsAndBytesConfig(
|
9 |
+
load_in_4bit=True,
|
10 |
+
bnb_4bit_quant_type="nf4",
|
11 |
+
bnb_4bit_compute_dtype=torch.bfloat16
|
12 |
+
)
|
13 |
+
|
14 |
+
|
15 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
16 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
|
17 |
def print_like_dislike(x: gr.LikeData):
|
18 |
print(x.index, x.value, x.liked)
|
19 |
|