Yehor commited on
Commit
2c3469f
·
verified ·
1 Parent(s): b38baf8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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.float16,
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 = compiled_model.generate(**inputs, max_new_tokens = 128)
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