Text Generation
Transformers
Safetensors
llama
Generated from Trainer
conversational
text-generation-inference
Instructions to use NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct") model = AutoModelForCausalLM.from_pretrained("NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct", device_map="auto") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct
- SGLang
How to use NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct 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 "NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct" \ --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": "NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct", "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 "NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct" \ --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": "NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct with Docker Model Runner:
docker model run hf.co/NAM00/context_tuned_patient_matching_Llama-3.2-1B-Instruct
Trained patient-matching model with context-tuning
Browse files- README.md +8 -7
- model.safetensors +1 -1
README.md
CHANGED
|
@@ -16,7 +16,7 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 16 |
|
| 17 |
This model is a fine-tuned version of [meta-llama/Llama-3.2-1B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct) on an unknown dataset.
|
| 18 |
It achieves the following results on the evaluation set:
|
| 19 |
-
- Loss: 1.
|
| 20 |
|
| 21 |
## Model description
|
| 22 |
|
|
@@ -35,7 +35,7 @@ More information needed
|
|
| 35 |
### Training hyperparameters
|
| 36 |
|
| 37 |
The following hyperparameters were used during training:
|
| 38 |
-
- learning_rate:
|
| 39 |
- train_batch_size: 1
|
| 40 |
- eval_batch_size: 1
|
| 41 |
- seed: 42
|
|
@@ -43,17 +43,18 @@ The following hyperparameters were used during training:
|
|
| 43 |
- total_train_batch_size: 8
|
| 44 |
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 45 |
- lr_scheduler_type: cosine
|
|
|
|
| 46 |
- num_epochs: 5
|
| 47 |
|
| 48 |
### Training results
|
| 49 |
|
| 50 |
| Training Loss | Epoch | Step | Validation Loss |
|
| 51 |
|:-------------:|:------:|:----:|:---------------:|
|
| 52 |
-
|
|
| 53 |
-
| 13.
|
| 54 |
-
| 13.
|
| 55 |
-
| 13.
|
| 56 |
-
| 13.
|
| 57 |
|
| 58 |
|
| 59 |
### Framework versions
|
|
|
|
| 16 |
|
| 17 |
This model is a fine-tuned version of [meta-llama/Llama-3.2-1B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct) on an unknown dataset.
|
| 18 |
It achieves the following results on the evaluation set:
|
| 19 |
+
- Loss: 1.6620
|
| 20 |
|
| 21 |
## Model description
|
| 22 |
|
|
|
|
| 35 |
### Training hyperparameters
|
| 36 |
|
| 37 |
The following hyperparameters were used during training:
|
| 38 |
+
- learning_rate: 6e-05
|
| 39 |
- train_batch_size: 1
|
| 40 |
- eval_batch_size: 1
|
| 41 |
- seed: 42
|
|
|
|
| 43 |
- total_train_batch_size: 8
|
| 44 |
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 45 |
- lr_scheduler_type: cosine
|
| 46 |
+
- lr_scheduler_warmup_steps: 1000
|
| 47 |
- num_epochs: 5
|
| 48 |
|
| 49 |
### Training results
|
| 50 |
|
| 51 |
| Training Loss | Epoch | Step | Validation Loss |
|
| 52 |
|:-------------:|:------:|:----:|:---------------:|
|
| 53 |
+
| 21.2622 | 1.0 | 933 | 1.7363 |
|
| 54 |
+
| 13.5357 | 2.0 | 1866 | 1.6952 |
|
| 55 |
+
| 13.1942 | 3.0 | 2799 | 1.6826 |
|
| 56 |
+
| 13.0838 | 4.0 | 3732 | 1.6599 |
|
| 57 |
+
| 13.0959 | 4.9949 | 4660 | 1.6620 |
|
| 58 |
|
| 59 |
|
| 60 |
### Framework versions
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 2471645608
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96cb3517f98807c5b70929ed89a2f2436f1114316b05129d461b8ceb3284e595
|
| 3 |
size 2471645608
|