We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import torch from transformers import AutoModelForCausalLM, AutoTokenizer import torch._dynamo
import os os.environ["TOKENIZERS_PARALLELISM"] = "false" torch._dynamo.config.suppress_errors = True
model_name = "../Meta-Llama-3-8B" device = torch.device("cpu") model = AutoModelForCausalLM.from_pretrained( model_name, torch_dtype="auto", device_map="auto", offload_folder="offload_folder" ) tokenizer = AutoTokenizer.from_pretrained(model_name) model = model.half() prompt = "请给我一个关于大型语言模型的简短介绍。" inputs = tokenizer(prompt, return_tensors="pt").to(device)
opt_linear_module = torch.compile(model, backend="turbine_cpu") print(opt_linear_module) with torch.no_grad(): export = opt_linear_module(**inputs)
error:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch._dynamo
import os
os.environ["TOKENIZERS_PARALLELISM"] = "false"
torch._dynamo.config.suppress_errors = True
model_name = "../Meta-Llama-3-8B"
device = torch.device("cpu")
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto",
offload_folder="offload_folder"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = model.half()
prompt = "请给我一个关于大型语言模型的简短介绍。"
inputs = tokenizer(prompt, return_tensors="pt").to(device)
opt_linear_module = torch.compile(model, backend="turbine_cpu")
print(opt_linear_module)
with torch.no_grad():
export = opt_linear_module(**inputs)
error:
The text was updated successfully, but these errors were encountered: