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
File size: 780 Bytes
a786270 | 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 | import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
def main():
model_path = "./" # lub ścieżka do folderu z modelem
print("Ładowanie tokenizera i modelu...")
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSeq2SeqLM.from_pretrained(model_path)
while True:
text = input("Wpisz tekst do przetworzenia (lub wpisz 'exit' aby zakończyć): ")
if text.lower() == "exit":
print("Koniec.")
break
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print("Wynik generacji:", result)
print("-" * 40)
if __name__ == "__main__":
main()
|