Instructions to use substratusai/weaviate-gorilla-v4-random-split-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use substratusai/weaviate-gorilla-v4-random-split-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="substratusai/weaviate-gorilla-v4-random-split-gguf", filename="weaviate-gorilla-random-split-Q4_K_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use substratusai/weaviate-gorilla-v4-random-split-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf substratusai/weaviate-gorilla-v4-random-split-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf substratusai/weaviate-gorilla-v4-random-split-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf substratusai/weaviate-gorilla-v4-random-split-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf substratusai/weaviate-gorilla-v4-random-split-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 substratusai/weaviate-gorilla-v4-random-split-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf substratusai/weaviate-gorilla-v4-random-split-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 substratusai/weaviate-gorilla-v4-random-split-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf substratusai/weaviate-gorilla-v4-random-split-gguf:Q4_K_M
Use Docker
docker model run hf.co/substratusai/weaviate-gorilla-v4-random-split-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use substratusai/weaviate-gorilla-v4-random-split-gguf with Ollama:
ollama run hf.co/substratusai/weaviate-gorilla-v4-random-split-gguf:Q4_K_M
- Unsloth Studio
How to use substratusai/weaviate-gorilla-v4-random-split-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 substratusai/weaviate-gorilla-v4-random-split-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 substratusai/weaviate-gorilla-v4-random-split-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for substratusai/weaviate-gorilla-v4-random-split-gguf to start chatting
- Atomic Chat new
- Docker Model Runner
How to use substratusai/weaviate-gorilla-v4-random-split-gguf with Docker Model Runner:
docker model run hf.co/substratusai/weaviate-gorilla-v4-random-split-gguf:Q4_K_M
- Lemonade
How to use substratusai/weaviate-gorilla-v4-random-split-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull substratusai/weaviate-gorilla-v4-random-split-gguf:Q4_K_M
Run and chat with the model
lemonade run user.weaviate-gorilla-v4-random-split-gguf-Q4_K_M
List all available models
lemonade list
Dataset
Finetuned on: https://huggingface.co/datasets/weaviate/WeaviateGraphQLGorilla-RandomSplit-Train
Prompt template
## Instruction
Your task is to write GraphQL for the Natural Language Query provided. Use the provided API reference and Schema to generate the GraphQL. The GraphQL should be valid for Weaviate.
Only use the API reference to understand the syntax of the request.
## Natural Language Query
{nlcommand}
## Schema
{schema}
## API reference
{apiRef}
## Answer
{output}
Example usage
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "substratusai/weaviate-gorilla-v4-random-split"
model = AutoModelForCausalLM.from_pretrained(
model_id,
load_in_4bit=True,
device_map='auto',
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
text = """
## Instruction
Your task is to write GraphQL for the Natural Language Query provided. Use the provided API reference and Schema to generate the GraphQL. The GraphQL should be valid for Weaviate.
Only use the API reference to understand the syntax of the request.
## Natural Language Query
```text Get me the top 10 historical events related to 'World War II', and show the event name, description, year, significant impact, and the names and populations of the involved countries. ```
## Schema
{ "classes": [ { "class": "HistoricalEvent", "description": "Information about historical events", "vectorIndexType": "hnsw", "vectorizer": "text2vec-transformers", "properties": [ { "name": "eventName", "dataType": ["text"], "description": "Name of the historical event" }, { "name": "description", "dataType": ["text"], "description": "Detailed description of the event" }, { "name": "year", "dataType": ["int"], "description": "Year the event occurred" }, { "name": "hadSignificantImpact", "dataType": ["boolean"], "description": "Whether the event had a significant impact" }, { "name": "involvedCountries", "dataType": ["Country"], "description": "Countries involved in the event" }{ "class": "Country", "description": "Information about countries", "vectorIndexType": "hnsw", "vectorizer": "text2vec-transformers", "properties": [ { "name": "countryName", "dataType": ["text"], "description": "Name of the country" }, { "name": "population", "dataType": ["int"], "description": "Population of the country" }}}
## API reference
1. Limit BM25 search results Limit the results[] You can limit the number of results returned by a `bm25` search, - to a fixed number, using the `limit: <N>` operator - to the first N "drops" in `score`, using the `autocut` operator `autocut` can be combined with `limit: N`, which would limit autocut's input to the first `N` objects. Limiting the number of results Use the `limit` argument to specify the maximum number of results that should be returned: ```graphql { Get { JeopardyQuestion( bm25: { query: "safety" }, limit: 3 ) { question answer _additional { score } } } } ```
## Answer
```graphql
"""
device = "cuda:0"
inputs = tokenizer(text, return_tensors="pt").to(device)
# this was needed due to a issue with model not taking token_type_ids
# inputs.pop("token_type_ids")
outputs = model.generate(**inputs, max_new_tokens=300)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 21
Hardware compatibility
Log In to add your hardware
4-bit
16-bit
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support