Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,6 +31,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
31 |
model = PeftModel.from_pretrained(model, lora_path)
|
32 |
model = model.merge_and_unload()
|
33 |
model.eval()
|
|
|
34 |
|
35 |
model.config.use_cache = True
|
36 |
|
@@ -56,6 +57,8 @@ def call(related_materials, materials, question):
|
|
56 |
start_time = time.time()
|
57 |
generated_ids = model.generate(
|
58 |
model_inputs.input_ids,
|
|
|
|
|
59 |
max_length=8096
|
60 |
)
|
61 |
|
|
|
31 |
model = PeftModel.from_pretrained(model, lora_path)
|
32 |
model = model.merge_and_unload()
|
33 |
model.eval()
|
34 |
+
model = torch.compile(model)
|
35 |
|
36 |
model.config.use_cache = True
|
37 |
|
|
|
57 |
start_time = time.time()
|
58 |
generated_ids = model.generate(
|
59 |
model_inputs.input_ids,
|
60 |
+
attention_mask=model_inputs.attention_mask,
|
61 |
+
do_sample=False,
|
62 |
max_length=8096
|
63 |
)
|
64 |
|