Update hf-inference-example.py

main
randaller 3 years ago committed by GitHub
parent b303ebfd92
commit a31651c9f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,5 @@
import llamahf
import os
# # to save memory use bfloat16 on cpu
# import torch
@ -9,7 +10,8 @@ MODEL = 'decapoda-research/llama-7b-hf'
# MODEL = 'decapoda-research/llama-30b-hf'
# MODEL = 'decapoda-research/llama-65b-hf'
# MODEL = './trained'
if os.path.exists('./trained'):
MODEL = './trained'
tokenizer = llamahf.LLaMATokenizer.from_pretrained(MODEL)
model = llamahf.LLaMAForCausalLM.from_pretrained(MODEL, low_cpu_mem_usage=True)

Loading…
Cancel
Save