Instructions to use PiyushLavaniya/Llama2_Banker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PiyushLavaniya/Llama2_Banker with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PiyushLavaniya/Llama2_Banker") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PiyushLavaniya/Llama2_Banker") model = AutoModelForCausalLM.from_pretrained("PiyushLavaniya/Llama2_Banker") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use PiyushLavaniya/Llama2_Banker with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PiyushLavaniya/Llama2_Banker" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PiyushLavaniya/Llama2_Banker", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PiyushLavaniya/Llama2_Banker
- SGLang
How to use PiyushLavaniya/Llama2_Banker with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "PiyushLavaniya/Llama2_Banker" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PiyushLavaniya/Llama2_Banker", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "PiyushLavaniya/Llama2_Banker" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PiyushLavaniya/Llama2_Banker", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PiyushLavaniya/Llama2_Banker with Docker Model Runner:
docker model run hf.co/PiyushLavaniya/Llama2_Banker
Model Card for Model ID
I've fine-tuned a language model to be my virtual banker, tailored to understand financial nuances and navigate the intricacies of banking tasks.
Model Details
I've fine-tuned LLama2, a Language Model, to function as my virtual banking assistant. This personalized AI understands the intricacies of financial tasks, allowing me to seamlessly instruct it for a range of banking activities. From transaction analysis to insights on investment opportunities, LLama2 has become my digital finance companion, making banking more efficient and tailored to my specific needs.
- Finetuned from model: meta-llama/Llama-2-7b-chat-hf
Model Sources
- Repository: https://github.com/PiyushLavaniya/Finetuning-Llama2/blob/main/Llama2_Banker_Finetuned_Llama.ipynb
Uses
The model's intended use is essential for ethical deployment. It's designed to assist users in tasks related to natural language understanding, generation, and text-based applications. Foreseeable users include developers, researchers, and businesses seeking advanced language processing capabilities. The model's impact extends to those directly interacting with its outputs, as well as downstream users affected by applications incorporating its features. Transparency in communicating the model's strengths, limitations, and potential biases is crucial to ensure responsible and informed usage by all stakeholders.
How to Get Started with the Model
Use the code below to get started with the model.
Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="PiyushLavaniya/Llama2_Banker")
Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("PiyushLavaniya/Llama2_Banker") model = AutoModelForCausalLM.from_pretrained("PiyushLavaniya/Llama2_Banker")
Training Details
Training Data
Model is Finetuned on ssbuild/alpaca_finance_en Fine-tuning model on the ssbuild/alpaca_finance_en dataset signifies a strategic customization for financial applications, possibly related to Alpaca Finance. the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
Training Hyperparameters
- Training regime: adam_bits = 8
training_arguments = TrainingArguments( per_device_train_batch_size = 1, gradient_accumulation_steps = 4, run_name=f"deb-v2-xl-{adam_bits}bitAdam", logging_steps = 20, learning_rate = 2e-4, fp16=True, max_grad_norm = 0.3, max_steps = 1200, warmup_ratio = 0.03, group_by_length=True, lr_scheduler_type = "constant", )
- Downloads last month
- 5