Views
No views yet
1from transformers import pipeline
2
3question = """Which alchemic objects are in the image?
4 Provide an answer in a well-structured JSON format with 12 classes (ampullae, animal, cucurbitae, cucurbitae-ambix,
5 ollae, cucurbitae-retorte, cucurbitae-rosenhut, furnace, human, mineral-metal,
6 other-equipment, plant) and the number of their occurences."""
7generator = pipeline("text-generation", model="maychnix/qwen2.5-3b-instruct-trl-sft-AlchObj", device="cuda")
8output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
9print(output["generated_text"])1@misc{vonwerra2022trl,
2 title = {{TRL: Transformer Reinforcement Learning}},
3 author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
4 year = 2020,
5 journal = {GitHub repository},
6 publisher = {GitHub},
7 howpublished = {\url{https://github.com/huggingface/trl}}
8}