Any-to-Any
Transformers
English
Polish
transformer
hardbanai, hardbanrecords, audio-generation, text-generation, image-generation, ai-publishing, creative-ai, emotional-style, multimodal, polish-language, musicgen
Instructions to use HardbanRecordsLab/HardbanAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HardbanRecordsLab/HardbanAI with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("HardbanRecordsLab/HardbanAI", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download inference.py from HardbanRecordsLab/HardbanAI: direct link, hf CLI and curl.
- Browser
- Download file 542 Bytes
-
https://huggingface.co/HardbanRecordsLab/HardbanAI/resolve/main/inference.py
- Command line
-
hf download hf://HardbanRecordsLab/HardbanAI/inference.py
-
curl -L -o inference.py https://huggingface.co/HardbanRecordsLab/HardbanAI/resolve/main/inference.py
542 Bytes
| --- | |
| ### 6. `inference.py` | |
| ```python | |
| import torch | |
| from transformers import AutoTokenizer, AutoModelForSeq2SeqLM | |
| def main(): | |
| model_name = "hardbanai-model" | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| model = AutoModelForSeq2SeqLM.from_pretrained(model_name) | |
| text = input("Wpisz tekst: ") | |
| inputs = tokenizer(text, return_tensors="pt") | |
| outputs = model.generate(**inputs) | |
| result = tokenizer.decode(outputs[0], skip_special_tokens=True) | |
| print("Wynik:", result) | |
| if __name__ == "__main__": | |
| main() | |