festvox/cmu_hinglish_dog
Viewer β’ Updated β’ 9.96k β’ 310 β’ 9
How to use Hinglish-Project/llama-3-8b-English-to-Hinglish with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Hinglish-Project/llama-3-8b-English-to-Hinglish") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Hinglish-Project/llama-3-8b-English-to-Hinglish")
model = AutoModelForCausalLM.from_pretrained("Hinglish-Project/llama-3-8b-English-to-Hinglish", device_map="auto")How to use Hinglish-Project/llama-3-8b-English-to-Hinglish with llama.cpp:
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M # Run inference directly in the terminal: llama cli -hf Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M # Run inference directly in the terminal: llama cli -hf Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M
docker model run hf.co/Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M
How to use Hinglish-Project/llama-3-8b-English-to-Hinglish with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Hinglish-Project/llama-3-8b-English-to-Hinglish"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Hinglish-Project/llama-3-8b-English-to-Hinglish",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M
How to use Hinglish-Project/llama-3-8b-English-to-Hinglish with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Hinglish-Project/llama-3-8b-English-to-Hinglish" \
--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": "Hinglish-Project/llama-3-8b-English-to-Hinglish",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "Hinglish-Project/llama-3-8b-English-to-Hinglish" \
--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": "Hinglish-Project/llama-3-8b-English-to-Hinglish",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Hinglish-Project/llama-3-8b-English-to-Hinglish with Ollama:
ollama run hf.co/Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M
How to use Hinglish-Project/llama-3-8b-English-to-Hinglish with Unsloth Studio:
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 Hinglish-Project/llama-3-8b-English-to-Hinglish to start chatting
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 Hinglish-Project/llama-3-8b-English-to-Hinglish to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Hinglish-Project/llama-3-8b-English-to-Hinglish to start chatting
How to use Hinglish-Project/llama-3-8b-English-to-Hinglish with Docker Model Runner:
docker model run hf.co/Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M
How to use Hinglish-Project/llama-3-8b-English-to-Hinglish with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Hinglish-Project/llama-3-8b-English-to-Hinglish:Q4_K_M
lemonade run user.llama-3-8b-English-to-Hinglish-Q4_K_M
lemonade list
lemonade run user.llama-3-8b-English-to-Hinglish-lemonade list!pip install -q "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
!pip install -q --no-deps "xformers<0.0.26" trl peft accelerate bitsandbytes
from unsloth import FastLanguageModel
import torch
max_seq_length = 512
dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
load_in_4bit = True # Use 4bit quantization to reduce memory usage. Can be False.
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "Hinglish-Project/llama-3-8b-English-to-Hinglish",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
)
def pipe(prompt):
alpaca_prompt = """### Instrucion: Translate given text to Hinglish Text:
### Input:
{}
### Response:
"""
inputs = tokenizer(
[
alpaca_prompt.format(prompt),
], return_tensors = "pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 2048, use_cache = True)
raw_text = tokenizer.batch_decode(outputs)[0]
return raw_text.split("### Response:\n")[1].split("<|end_of_text|>")[0]
text = "This is a fine-tuned Hinglish translation model using Llama 3."
pipe(text)
## yeh ek fine-tuned Hinglish translation model hai jisme Llama 3 ka use kiya gaya hai.
This Llama3 model was trained 2x faster with Unsloth and Huggingface's TRL library.
Pull the model
# Download Lemonade from https://lemonade-server.ai/lemonade pull Hinglish-Project/llama-3-8b-English-to-Hinglish: