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 -1
handler.py
CHANGED
|
@@ -72,7 +72,8 @@ class EndpointHandler:
|
|
| 72 |
)
|
| 73 |
|
| 74 |
prediction = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 75 |
-
|
|
|
|
| 76 |
end_index = prediction.find("</presentation>") + 15
|
| 77 |
prediction = prediction[start_index:end_index]
|
| 78 |
|
|
|
|
| 72 |
)
|
| 73 |
|
| 74 |
prediction = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 75 |
+
start_indices = positions = [i for i in range(len(prediction)) if s.startswith("<presentation>", i)]
|
| 76 |
+
start_index = start_indices[-1]
|
| 77 |
end_index = prediction.find("</presentation>") + 15
|
| 78 |
prediction = prediction[start_index:end_index]
|
| 79 |
|