Spaces:
Sleeping
Sleeping
Jeff Myers II
commited on
Commit
·
f24da04
1
Parent(s):
cb4974b
Completed Prototype
Browse files
Gemma.py
CHANGED
|
@@ -18,9 +18,10 @@ class GemmaLLM:
|
|
| 18 |
self.model = Gemma3ForCausalLM.from_pretrained(
|
| 19 |
model_id,
|
| 20 |
device_map="cuda" if torch.cuda.is_available() else "cpu",
|
| 21 |
-
torch_dtype=torch.
|
| 22 |
-
# token=os.environ.get("GEMMA_TOKEN"),
|
| 23 |
).eval()
|
|
|
|
|
|
|
| 24 |
|
| 25 |
@spaces.GPU
|
| 26 |
def generate(self, message) -> str:
|
|
|
|
| 18 |
self.model = Gemma3ForCausalLM.from_pretrained(
|
| 19 |
model_id,
|
| 20 |
device_map="cuda" if torch.cuda.is_available() else "cpu",
|
| 21 |
+
torch_dtype=torch.float16,
|
|
|
|
| 22 |
).eval()
|
| 23 |
+
|
| 24 |
+
self.model = self.model.bfloat16()
|
| 25 |
|
| 26 |
@spaces.GPU
|
| 27 |
def generate(self, message) -> str:
|