llama #259
-
can this project support llama? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Of course, we have included a tutorial to use GPT-J to train Chat AI. You can use similar approach to train Llama, for example from openprompt import plms
from openprompt.plms import *
from transformers import GPTJConfig, GPTJModel, GPTJForCausalLM, GPT2Tokenizer, LlamaConfig, LlamaForCausalLM, LlamaTokenizer
plms._MODEL_CLASSES["gptj"]= ModelClass(**{"config": GPTJConfig, "tokenizer": GPT2Tokenizer, "model": GPTJForCausalLM, "wrapper": LMTokenizerWrapper})
plms._MODEL_CLASSES["llama"]= ModelClass(**{"config": LlamaConfig, "tokenizer": LlamaTokenizer, "model": LlamaForCausalLM, "wrapper": LMTokenizerWrapper}) Please note that we are not distributing Llama checkpoints. |
Beta Was this translation helpful? Give feedback.
-
How to solve the logits equality of LLaMA output?This is my code.from datasets import load_dataset device = "cuda" accelerator = Accelerator() data_path = 'data' for item in data: from openprompt import plms from openprompt.plms import load_plm from openprompt.prompts import ManualTemplate promptTemplate = ManualTemplate( from openprompt.prompts import ManualVerbalizer from openprompt import PromptForClassification data_loader = PromptDataLoader(dataset=dataset, tokenizer=tokenizer, template=promptTemplate, import torch promptModel.eval() from sklearn.metrics import accuracy_score accuracy = accuracy_score(y_true, predictions) The output logits is :tensor([[-1.3863, -1.3863]]) |
Beta Was this translation helpful? Give feedback.
Of course, we have included a tutorial to use GPT-J to train Chat AI. You can use similar approach to train Llama, for example
Please note that we are not distributing Llama checkpoints.