Downloads · 30 days
17
2% of all-time downloads
ItbearZhang/facebook-opt-125m-with-alpacadataset
facebook-opt-125m-with-alpacadataset is a text generation model from ItbearZhang. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This is ItbearZhang/facebook-opt-125m-with-alpacadataset using the dataset from tatsu-lab/stanfordalpaca: Code and documentation to train Stanford's Alpaca models, and generate the data. (github.com) and the opt-125m…
Downloads · 30 days
17
2% of all-time downloads
All-time downloads
712
Public
Repo size
2 GB
Likes
0
Public
Click a slice to open those files.
.bin501 MB · 100%
From the Hugging Face model README
This is ItbearZhang/facebook-opt-125m-with-alpacadataset using the dataset from tatsu-lab/stanford_alpaca: Code and documentation to train Stanford's Alpaca models, and generate the data. (github.com) and the opt-125m pretrained lm model from facebook/opt-125m.
from transformers import pipeline
def generate_by_pipeline(instruction, inputs=""):
if inputs == "":
prompt = f"### Instruction:\n{instruction}\n\n### Response:"
else:
prompt = f"### Instruction:\n{instruction}\n\n### Input:\n{inputs}\n\n### Response:"
return generator(prompt)[0]['generated_text']
print(generate_by_pipeline("What is the capital of China?"))