Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,10 @@ text_generator = None
|
|
10 |
is_hugging_face = True
|
11 |
model_id = "google/gemma-2-9b-it"
|
12 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
|
|
|
|
|
|
|
|
13 |
if not huggingface_token:
|
14 |
pass
|
15 |
print("no HUGGINGFACE_TOKEN if you need set secret ")
|
@@ -22,9 +26,7 @@ def init():
|
|
22 |
|
23 |
#model_id = "microsoft/Phi-3-mini-128k-instruct"
|
24 |
|
25 |
-
|
26 |
-
device = "cuda"
|
27 |
-
dtype = torch.bfloat16
|
28 |
|
29 |
tokenizer = AutoTokenizer.from_pretrained(model_id, token=huggingface_token)
|
30 |
|
|
|
10 |
is_hugging_face = True
|
11 |
model_id = "google/gemma-2-9b-it"
|
12 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
13 |
+
device = "auto" # torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
14 |
+
device = "cuda"
|
15 |
+
dtype = torch.bfloat16
|
16 |
+
|
17 |
if not huggingface_token:
|
18 |
pass
|
19 |
print("no HUGGINGFACE_TOKEN if you need set secret ")
|
|
|
26 |
|
27 |
#model_id = "microsoft/Phi-3-mini-128k-instruct"
|
28 |
|
29 |
+
|
|
|
|
|
30 |
|
31 |
tokenizer = AutoTokenizer.from_pretrained(model_id, token=huggingface_token)
|
32 |
|