Model Description
llama2-navigation is a Larage Language Model (LLM) that is a fine-tuned version of mistralai/Mistral-7B-Instruct-v0.2. This model aims to provide navigation instructions given knowledge.
The model was fine-tuned with Lora and custom training data(voxreality/navigation_intructions_v2). For more details about the model's use case, you can find the code at the following link:
How to Get Started with the Model
Below you can find an example of model usage:
import torch, textwrap
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig, pipeline
from langchain import HuggingFacePipeline, PromptTemplate
from langchain.chains import LLMChain
model_name = "voxreality/mistral-7B-navigation-new-instructions"
user_msg = "I need to go to the social area."
knowledge = "start, turn left, crossing yellow sphere left, arrive wall opening, turn left, turn right, pass corridor, crossing magenta sphere left, arrive conference room, finish"
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=True)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, trust_remote_code=True, device_map="auto")
generation_config = GenerationConfig.from_pretrained(model_name)
generation_config.max_new_tokens = 1024
generation_config.temperature = 0.0001
generation_config.top_p = 0.95
generation_config.do_sample = True
generation_config.repetition_penalty = 1.15
text_pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer, generation_config=generation_config)
llm = HuggingFacePipeline(pipeline=text_pipeline, model_kwargs={"temperature": 0})
text_pipeline = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
generation_config=generation_config)
model = HuggingFacePipeline(pipeline=text_pipeline, model_kwargs={"temperature": 0})
prompt = textwrap.dedent("""
[INST] <>
You are a navigation assistant at a conference venue. Your task is to guide users to specific locations within the venue, including "booth 1", "booth 2", "booth 3", "booth 4", "social area", "exit", "business room", and "conference room".
- For clear directions, respond with numbered steps using the details provided in the 'knowledge' field.
- Ensure to translate the directions from the 'knowledge' field into a user-friendly format with clear, numbered steps."
"" \n\n
<>
### input: {input}
### knowledge: {knowledge}
[/INST]
""")
prompt = PromptTemplate(input_variables=["input", "knowledge"], template= prompt)
chain = LLMChain(llm=model, prompt=prompt)
print(chain.run(input=user_msg, knowledge=knowledge))
- Downloads last month
- 64
Model tree for voxreality/mistral-7B-navigation-new-instructions
Base model
mistralai/Mistral-7B-Instruct-v0.2