CineAI/Free_Thought_Frontiers
Viewer • Updated • 60 • 10
How to use CineAI/Free-Thought-Frontiers-Llama32-8B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="CineAI/Free-Thought-Frontiers-Llama32-8B") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("CineAI/Free-Thought-Frontiers-Llama32-8B", dtype="auto")How to use CineAI/Free-Thought-Frontiers-Llama32-8B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "CineAI/Free-Thought-Frontiers-Llama32-8B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "CineAI/Free-Thought-Frontiers-Llama32-8B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/CineAI/Free-Thought-Frontiers-Llama32-8B
How to use CineAI/Free-Thought-Frontiers-Llama32-8B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "CineAI/Free-Thought-Frontiers-Llama32-8B" \
--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": "CineAI/Free-Thought-Frontiers-Llama32-8B",
"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 "CineAI/Free-Thought-Frontiers-Llama32-8B" \
--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": "CineAI/Free-Thought-Frontiers-Llama32-8B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use CineAI/Free-Thought-Frontiers-Llama32-8B 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 CineAI/Free-Thought-Frontiers-Llama32-8B 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 CineAI/Free-Thought-Frontiers-Llama32-8B to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for CineAI/Free-Thought-Frontiers-Llama32-8B to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="CineAI/Free-Thought-Frontiers-Llama32-8B",
max_seq_length=2048,
)How to use CineAI/Free-Thought-Frontiers-Llama32-8B with Docker Model Runner:
docker model run hf.co/CineAI/Free-Thought-Frontiers-Llama32-8B
You can use the following example using the Unsloth interface
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
{}
### Input:
{}
### Response:
{}"""
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "CineAI/Free-Thought-Frontiers-Llama32-8B",
max_seq_length = 2048,
dtype = None,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
inputs = tokenizer(
[
alpaca_prompt.format(
"Insert here quote or ststement", # instruction
"", # input leave empty
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer)
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 2048)
Or you can use AutoModelForPeftCausalLM, but it is 2x slower than Unsloth
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
model = AutoPeftModelForCausalLM.from_pretrained(
"CineAI/Free-Thought-Frontiers-Llama32-8B",
load_in_4bit = True,
)
tokenizer = AutoTokenizer.from_pretrained("CineAI/Free-Thought-Frontiers-Llama32-8B")
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
Base model
meta-llama/Llama-3.1-8B