Minor improvement while running custom models
This commit is contained in:
@@ -97,6 +97,7 @@ def generate_reply(question, max_new_tokens, do_sample, temperature, top_p, typi
|
|||||||
print(f"Output generated in {(t1-t0):.2f} seconds.")
|
print(f"Output generated in {(t1-t0):.2f} seconds.")
|
||||||
yield formatted_outputs(reply, shared.model_name)
|
yield formatted_outputs(reply, shared.model_name)
|
||||||
else:
|
else:
|
||||||
|
yield formatted_outputs(question, shared.model_name)
|
||||||
for i in tqdm(range(max_new_tokens//8+1)):
|
for i in tqdm(range(max_new_tokens//8+1)):
|
||||||
clear_torch_cache()
|
clear_torch_cache()
|
||||||
reply = shared.model.generate(question, token_count=8, temperature=temperature, top_p=top_p)
|
reply = shared.model.generate(question, token_count=8, temperature=temperature, top_p=top_p)
|
||||||
|
|||||||
Reference in New Issue
Block a user