peguses_chat_sum / README.md
Mudasir692's picture
Update README.md
795078f verified
---
# For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1
# Doc / guide: https://huggingface.co/docs/hub/model-cards
{}
---
# Model Card for Model ID
<!-- Provide a quick summary of what the model is/does. -->
This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
## Model Details
### Model Description
<!-- Provide a longer summary of what this model is. -->
- **Developed by:** Mudasir692
- **Model type:** transformer
- **Language(s) (NLP):** python
- **License:** MIT
- **Finetuned from model [optional]:** Peguses
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
## Bias, Risks, and Limitations
Model might not generate coherent summary to large extent.
[More Information Needed]
### Recommendations
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
## How to Get Started with the Model
import torch
from transformers import PegasusForConditionalGeneration, PegasusTokenizer
# Load the saved model and tokenizer
model_path = "peguses_chat_sum"
device = torch.device("cpu")
# Load the model and tokenizer from the saved directory
model = PegasusForConditionalGeneration.from_pretrained(model_path)
tokenizer = PegasusTokenizer.from_pretrained(model_path)
# Move the model to the correct device
model = model.to(device)
## How to Get Started with the Model
from transformers import PegasusForConditionalGeneration, PegasusTokenizer
model = PegasusForConditionalGeneration.from_pretrained("Mudasir692/peguses_chat_sum")
tokenizer = PegasusTokenizer.from_pretrained("Mudasir692/peguses_chat_sum")
input_text = """
#Person1#: Hey Alice, congratulations on your promotion!
#Person2#: Thank you so much! It means a lot to me. I’m still processing it, honestly.
#Person1#: You totally deserve it. Your hard work finally paid off. Let’s celebrate this weekend.
#Person2#: That sounds amazing. Dinner on me, okay?
#Person1#: Sure! Just let me know where and when. Oh, by the way, did you tell your family?
#Person2#: Yes, they were so excited. Mom’s already planning to bake a cake.
#Person1#: That’s wonderful! I’ll bring a gift too. It’s such a big milestone for you.
#Person2#: You’re the best. Thanks for always being so supportive.
"""
inputs = tokenizer(input_text, return_tensors="pt")
model.eval()
outputs = model.generate(**inputs, max_new_tokens=100)
generated_summary = tokenizer.decode(outputs[0], skip_special_tokens=True)
print("generated summary", generated_summary)