Spaces:
Running
on
Zero
Running
on
Zero
BramVanroy
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
import os
|
4 |
from threading import Thread
|
5 |
from typing import Iterator
|
|
|
6 |
|
7 |
import gradio as gr
|
8 |
# import spaces
|
@@ -15,7 +16,7 @@ MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "8192"))
|
|
15 |
|
16 |
if torch.cuda.is_available():
|
17 |
model_id = "BramVanroy/GEITje-ultra-dpo-5e-7lr-128tbs-0.1b"
|
18 |
-
model = AutoModelForCausalLM.from_pretrained(model_id,
|
19 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
20 |
|
21 |
|
|
|
3 |
import os
|
4 |
from threading import Thread
|
5 |
from typing import Iterator
|
6 |
+
import torch
|
7 |
|
8 |
import gradio as gr
|
9 |
# import spaces
|
|
|
16 |
|
17 |
if torch.cuda.is_available():
|
18 |
model_id = "BramVanroy/GEITje-ultra-dpo-5e-7lr-128tbs-0.1b"
|
19 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
|
20 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
21 |
|
22 |
|