ModelHub XC 2461517403 初始化项目,由ModelHub XC社区提供模型
Model: dilip025/llama-2-7b
Source: Original Platform
2026-06-04 10:10:17 +08:00

language, license, tags, model_name, arxiv, base_model, inference, model_creator, model_type, pipeline_tag, prompt_template, quantized_by
language license tags model_name arxiv base_model inference model_creator model_type pipeline_tag prompt_template quantized_by
en
llama2
facebook
meta
pytorch
llama
llama-2
Llama 2 7B Chat 2307.09288 meta-llama/Llama-2-7b-chat-hf false Meta Llama 2 llama text-generation [INST] <<SYS>> You are NutriLife chatbot, you are going to get questions related to food, nutrition, health, and diet by the users from Nepal. Answer them very shortly and accurately if the message is only about food, nutrition, and diet. Otherwise, ignore. <</SYS>> {prompt}[/INST] Dilip Pokhrel

# Llama 2 7B Chat -- Food and Nutrition
- Model creator: [Meta Llama 2]
- Original model: [Llama 2 7B Chat] Original Model
- Fine Tuned by: [Dilip Pokhrel] Profile

Simple example code to load one of these GGUF models

# Load model directly or use qunatization technique if you have low gpu ram

from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("dilip025/llama-2-7b")
model = AutoModelForCausalLM.from_pretrained("dilip025/llama-2-7b")
system_message = 'You are NutriLife chatbot, you are going to get questions related to food, nutrition, health, and diet by the users from Nepal. Answer them very shortly and accurately if the message is only about food, nutrition, and diet. Otherwise, ignore.'

prompt = f"[INST] <<SYS>>\n{system_message}\n<</SYS>>\n\n Tell me some of the famous Nepali food recipes [/INST]"
num_new_tokens = 200  # Change to the number of new tokens you want to generate

# Count the number of tokens in the prompt
num_prompt_tokens = len(tokenizer(prompt)['input_ids'])

# Calculate the maximum length for the generation
max_length = num_prompt_tokens + num_new_tokens

gen = pipeline('text-generation', model=model, tokenizer=tokenizer, max_length=max_length)
result = gen(prompt)
print(result[0]['generated_text'].replace(prompt, ''))

Ethical Considerations and Limitations

Llama 2 is a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Llama 2s potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Llama 2, developers should perform safety testing and tuning tailored to their specific applications of the model. Please see the Responsible Use Guide available at https://ai.meta.com/llama/responsible-use-guide/

Description
Model synced from source: dilip025/llama-2-7b
Readme 593 KiB