File size: 2,987 Bytes
8a7f1e1 795078f a057b65 8a7f1e1 a057b65 8a7f1e1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
---
# 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)
|