Instructions to use vitormesaque/i-llama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vitormesaque/i-llama with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vitormesaque/i-llama")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("vitormesaque/i-llama") model = AutoModelForCausalLM.from_pretrained("vitormesaque/i-llama") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use vitormesaque/i-llama with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vitormesaque/i-llama" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vitormesaque/i-llama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vitormesaque/i-llama
- SGLang
How to use vitormesaque/i-llama 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 "vitormesaque/i-llama" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vitormesaque/i-llama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "vitormesaque/i-llama" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vitormesaque/i-llama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio new
How to use vitormesaque/i-llama with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for vitormesaque/i-llama to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for vitormesaque/i-llama to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for vitormesaque/i-llama to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="vitormesaque/i-llama", max_seq_length=2048, ) - Docker Model Runner
How to use vitormesaque/i-llama with Docker Model Runner:
docker model run hf.co/vitormesaque/i-llama
Update README.md
Browse files
README.md
CHANGED
|
@@ -34,12 +34,42 @@ The vitormesaque/irisk dataset was obtained through the knowledge base of the MA
|
|
| 34 |
|
| 35 |
## Model Usage
|
| 36 |
|
|
|
|
| 37 |
### How to Get Started with the Model
|
| 38 |
|
| 39 |
Use the code below to get started with the model:
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
### Evaluation
|
| 44 |
|
| 45 |
The model was evaluated using a separate portion of the vitormesaque/irisk dataset.
|
|
|
|
| 34 |
|
| 35 |
## Model Usage
|
| 36 |
|
| 37 |
+
|
| 38 |
### How to Get Started with the Model
|
| 39 |
|
| 40 |
Use the code below to get started with the model:
|
| 41 |
|
| 42 |
+
```python
|
| 43 |
+
|
| 44 |
+
# Load model directly
|
| 45 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 46 |
+
|
| 47 |
+
tokenizer = AutoTokenizer.from_pretrained("vitormesaque/i-llama")
|
| 48 |
+
model = AutoModelForCausalLM.from_pretrained("vitormesaque/i-llama")
|
| 49 |
+
|
| 50 |
+
```
|
| 51 |
+
## Usage
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
|
| 55 |
|
| 56 |
+
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
| 57 |
+
inputs = tokenizer(
|
| 58 |
+
[
|
| 59 |
+
irisk_prompt.format(
|
| 60 |
+
"Extract issues from the user review in JSON format. For each issue, provide label, functionality, severity (1-5), likelihood (1-5), category (Bug, User Experience, Performance, Security, Compatibility, Functionality, UI, Connectivity, Localization, Accessibility, Data Handling, Privacy, Notifications, Account Management, Payment, Content Quality, Support, Updates, Syncing, Customization), and the sentence.", # instruction
|
| 61 |
+
"I used to love this app, but now it's become frustrating as hell. We can't see lyrics, we can't CHOOSE WHAT SONG WE WANT TO LISTEN TO, we can't skip a song more than a few times, there are ads after every two songs, and all in all it's a horrible overrated app. If I could give this 0 stars, I would.", # input
|
| 62 |
+
"", # output - leave this blank for generation!
|
| 63 |
+
)
|
| 64 |
+
], return_tensors = "pt").to("cuda")
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
from transformers import TextStreamer
|
| 68 |
+
text_streamer = TextStreamer(tokenizer)
|
| 69 |
+
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 512)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
```
|
| 73 |
### Evaluation
|
| 74 |
|
| 75 |
The model was evaluated using a separate portion of the vitormesaque/irisk dataset.
|