Instructions to use QuantFactory/AlchemistCoder-L-7B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use QuantFactory/AlchemistCoder-L-7B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="QuantFactory/AlchemistCoder-L-7B-GGUF", filename="AlchemistCoder-L-7B.Q2_K.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use QuantFactory/AlchemistCoder-L-7B-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M
Use pre-built binary
# 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 QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M
Build from source code
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 QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use QuantFactory/AlchemistCoder-L-7B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantFactory/AlchemistCoder-L-7B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantFactory/AlchemistCoder-L-7B-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M
- Ollama
How to use QuantFactory/AlchemistCoder-L-7B-GGUF with Ollama:
ollama run hf.co/QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M
- Unsloth Studio new
How to use QuantFactory/AlchemistCoder-L-7B-GGUF 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 QuantFactory/AlchemistCoder-L-7B-GGUF 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 QuantFactory/AlchemistCoder-L-7B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/AlchemistCoder-L-7B-GGUF to start chatting
- Docker Model Runner
How to use QuantFactory/AlchemistCoder-L-7B-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/AlchemistCoder-L-7B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/AlchemistCoder-L-7B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.AlchemistCoder-L-7B-GGUF-Q4_K_M
List all available models
lemonade list
output = llm(
"Once upon a time,",
max_tokens=512,
echo=True
)
print(output)QuantFactory/AlchemistCoder-L-7B-GGUF
This is quantized version of internlm/AlchemistCoder-L-7B created using llama.cpp
Model Description: AlchemistCoder
[π Paper] [π Project Page]
β¨ Highlights
Abstract: Open-source Large Language Models (LLMs) and their specialized variants, particularly Code LLMs, have recently delivered impressive performance. However, previous Code LLMs are typically fine-tuned on single-source data with limited quality and diversity, which may insufficiently elicit the potential of pre-trained Code LLMs. In this paper, we present AlchemistCoder, a series of Code LLMs with enhanced code generation and generalization capabilities fine-tuned on multi-source data. To achieve this, we pioneer to unveil inherent conflicts among the various styles and qualities in multi-source code corpora and introduce data-specific prompts with hindsight relabeling, termed AlchemistPrompts, to harmonize different data sources and instruction-response pairs. Additionally, we propose incorporating the data construction process into the fine-tuning data as code comprehension tasks, including instruction evolution, data filtering, and code review. Extensive experiments demonstrate that AlchemistCoder holds a clear lead among all models of the same size (6.7B/7B) and rivals or even surpasses larger models (15B/33B/70B), showcasing the efficacy of our method in refining instruction-following capabilities and advancing the boundaries of code intelligence.
- AlchemistPrompts: Designed as data-specific prompts for harmonizing inherent conflicts in multi-source data and mitigating the instruction/response misalignment at a fined-grained level.
- Code Comprehenstion Tasks: Sourced from the process of data construction, consisting of instruction evolution, data filtering, and code review.
- Harmonized Multi-source Data: Instruction tuned on 200M tokens, including 6 types of high-quality data.
- Superior Model Performance: Surpassing all the open-source models of the same size (6.7/7B), and rivaling or even beating larger models (15B/33B/70B/ChatGPT) on 6 code benchmarks.
- Advanced generic capabilities: Demonstrated by the significant improvements on MMLU, BBH, and GSM8K.
π Quick Start
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("internlm/AlchemistCoder-L-7B", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("internlm/AlchemistCoder-L-7B", trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
model = model.eval()
input_text = "Implement the Dijkstra algorithm in Python"
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_length=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
π§ͺ Evaluation and Fine-tune
Please refer to AlchemistCoder and InternLM.
π Acknowledgments
AlchemistCoder is built with InternLM and OpenCompass. Thanks for their awesome work!
- Downloads last month
- 141
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
Model tree for QuantFactory/AlchemistCoder-L-7B-GGUF
Base model
internlm/AlchemistCoder-L-7B
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="QuantFactory/AlchemistCoder-L-7B-GGUF", filename="", )