Instructions to use MCS12/llama-3-xml-presentation-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MCS12/llama-3-xml-presentation-generator with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MCS12/llama-3-xml-presentation-generator", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -71,7 +71,7 @@ class EndpointHandler:
|
|
| 71 |
do_sample=True,
|
| 72 |
repetition_penalty=1.15,
|
| 73 |
)
|
| 74 |
-
|
| 75 |
available_tags = ["presentation", "slide", "ul", "ol", "li", "h1", "h2", "h3", "p"]
|
| 76 |
available_stylings = ["bold", "italic", "underline", "color", "align", "fontSize"]
|
| 77 |
prediction = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
|
|
@@ -111,7 +111,7 @@ class EndpointHandler:
|
|
| 111 |
|
| 112 |
# Create messages following Llama 3's chat format
|
| 113 |
messages = [
|
| 114 |
-
{"role": "system", "content": f"Summarize the content into presentation slides in XML syntax with following parameters:\n Tone: {tone}\n Length: {length}\n Strictly use only the tags: <presentation>, <slide>, <h1>, <h2>, <p>, <ul>, <ol>, <li> only\n Strictly use only the available formatting: bold='
|
| 115 |
{"role": "user", "content": content}
|
| 116 |
]
|
| 117 |
|
|
|
|
| 71 |
do_sample=True,
|
| 72 |
repetition_penalty=1.15,
|
| 73 |
)
|
| 74 |
+
|
| 75 |
available_tags = ["presentation", "slide", "ul", "ol", "li", "h1", "h2", "h3", "p"]
|
| 76 |
available_stylings = ["bold", "italic", "underline", "color", "align", "fontSize"]
|
| 77 |
prediction = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
|
|
|
|
| 111 |
|
| 112 |
# Create messages following Llama 3's chat format
|
| 113 |
messages = [
|
| 114 |
+
{"role": "system", "content": f"Summarize the content into presentation slides in XML syntax with following parameters:\n Tone: {tone}\n Length: {length}\n Strictly use only the tags: <presentation>, <slide>, <h1>, <h2>, <p>, <ul>, <ol>, <li> only\n Strictly use only the available formatting: bold='true'/'false', italic='true'/'false', underline='true'/'false', color='red'/'green'/'yellow'/'blue', alight='left'/'center'/'right', fontSize=integer"},
|
| 115 |
{"role": "user", "content": content}
|
| 116 |
]
|
| 117 |
|