--- pipeline_tag: text-generation inference: true widget: - text: "What's lemur's favorite fruit?" example_title: Lemur favorite fruit group: Python - text: 'Write a Python function to merge two sorted lists into one sorted list without using any built-in sort functions.' example_title: Merge Sort group: Python license: llama2 library_name: transformers tags: - text-generation - code - text-generation-inference language: - en --- # lemur-70b-chat-v1

Lemur

Open large language models (LLMs) have traditionally been tailored for either textual or code-related tasks, with limited ability to effectively balance both. However, many complex language applications, particularly language model agents, demand systems with a multifaceted skill set encompassing understanding, reasoning, planning, coding, and context grounding. In this work, we introduce **Lemur-70B-v1** and **Lemur-70B-chat-v1**, the state-of-the-art open pretrained and supervised fine-tuned large language models balancing text and code intelligence.
## Use ### Setup First, we have to install all the libraries listed in `requirements.txt` in [GitHub](https://github.com/OpenLemur/lemur-v1): ```bash pip install -r requirements.txt ``` ### Generation ```python from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenLemur/lemur-70b-chat-v1") model = AutoModelForCausalLM.from_pretrained("OpenLemur/lemur-70b-chat-v1", device_map="auto", load_in_8bit=True) # Text Generation Example prompt = "What's lemur's favorite fruit?" input = tokenizer(prompt, return_tensors="pt") output = model.generate(**input, max_length=50, num_return_sequences=1) generated_text = tokenizer.decode(output[0], skip_special_tokens=True) print(generated_text) # Code Generation Example prompt = "Write a Python function to merge two sorted lists into one sorted list without using any built-in sort functions." input = tokenizer(prompt, return_tensors="pt") output = model.generate(**input, max_length=200, num_return_sequences=1) generated_code = tokenizer.decode(output[0], skip_special_tokens=True) print(generated_code) ``` # License The model is licensed under the Llama-2 community license agreement.