Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -19,9 +19,9 @@ tokenizer = AutoTokenizer.from_pretrained("ua-l/gemma-2-9b-legal-steps200-merged
|
|
19 |
model = AutoModelForCausalLM.from_pretrained(
|
20 |
"ua-l/gemma-2-9b-legal-steps200-merged-16bit-uk",
|
21 |
device_map='cuda',
|
22 |
-
torch_dtype=torch.
|
23 |
)
|
24 |
-
compiled_model = torch.compile(model, mode="default")
|
25 |
|
26 |
|
27 |
print('Model dtype:', model.dtype)
|
@@ -36,7 +36,7 @@ def predict(question):
|
|
36 |
### Answer:
|
37 |
'''], return_tensors = "pt").to("cuda")
|
38 |
|
39 |
-
outputs =
|
40 |
|
41 |
results = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
42 |
|
|
|
19 |
model = AutoModelForCausalLM.from_pretrained(
|
20 |
"ua-l/gemma-2-9b-legal-steps200-merged-16bit-uk",
|
21 |
device_map='cuda',
|
22 |
+
torch_dtype=torch.bfloat16,
|
23 |
)
|
24 |
+
# compiled_model = torch.compile(model, mode="default")
|
25 |
|
26 |
|
27 |
print('Model dtype:', model.dtype)
|
|
|
36 |
### Answer:
|
37 |
'''], return_tensors = "pt").to("cuda")
|
38 |
|
39 |
+
outputs = model.generate(**inputs, max_new_tokens = 128)
|
40 |
|
41 |
results = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
42 |
|