Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "astom-M/matsuo-llm-advanced-household-agent"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
6
7# Example task
8messages = [
9 {"role": "user", "content": "You are in the middle of a room. Looking quickly around you, you see a desk 1, a drawer 1, a shelf 1.\n\nYour task is to: put a laptop on desk."}
10]
11
12text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
13inputs = tokenizer(text, return_tensors="pt").to(model.device)
14
15outputs = model.generate(**inputs, max_new_tokens=128, temperature=0.7)
16response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
17print(response)THOUGHT: I need to find a laptop and put it on the desk.
ACTION: go to desk 11@misc{matsuo-llm-advanced-2025,
2 author = {Matsuo Lab LLM Course 2025},
3 title = {Household Task Agent - Advanced Competition},
4 year = {2025},
5 publisher = {HuggingFace},
6 howpublished = {\url{https://huggingface.co/astom-M/matsuo-llm-advanced-household-agent}}
7}