Downloads · 30 days
17
3% of all-time downloads
ihgn/similar-questions
similar-questions is a text generation model from ihgn. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
17
3% of all-time downloads
All-time downloads
506
Public
Repo size
2.8 GB
Likes
1
Public
Click a slice to open those files.
.bin242 MB · 100%
From the Hugging Face model README
from transformers import pipeline
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("ihgn/similar-questions")
model = AutoModelForSeq2SeqLM.from_pretrained("ihgn/similar-questions")
model = pipeline("text2text-generation", model=model_name)
generation_config = {
"max_length": 512,
"num_beams": 1,
"top_k": 50,
"top_p": 0.92,
"do_sample": True,
"num_return_sequences": 1
}
input_text= "Your input text goes here."
input_ids = tokenizer.encode(input_text, return_tensors="pt")
generated_ids = model(input_ids, **generation_config)
generated_text = tokenizer.decode(generated_ids.squeeze(), skip_special_tokens=True)
print(generated_text)