Views
No views yet
.md files, making it highly specialized for understanding, explaining, and helping you work with the OpenClaw ecosystem..md)1from unsloth import FastLanguageModel
2import torch
3
4max_seq_length = 2048 # Supports RoPE scaling internally
5dtype = None # Auto detect (Float16 / BFloat16)
6load_in_4bit = True # Reduce memory usage
7
8from transformers import TextStreamer
9
10model, tokenizer = FastLanguageModel.from_pretrained(
11 model_name="unsloth/mistral-7b-v0.3",
12 max_seq_length=2048,
13)
14
15# Load OpenClaw adapter
16model.load_adapter("Ishant06/OpenClaw-Continuous-Pretraining")
17
18# Device setup
19device = "cuda" if torch.cuda.is_available() else "cpu"
20
21# ---- TEST INPUT ----
22prompt = "how to use openclaw with docker?"
23
24inputs = tokenizer(
25 prompt,
26 return_tensors="pt"
27).to(device)
28
29# Generate output
30outputs = model.generate(
31 **inputs,
32 max_new_tokens=2048,
33 temperature=0.7,
34 top_p=0.9,
35 do_sample=True,
36)
37
38# Decode response
39response = tokenizer.decode(outputs[0], skip_special_tokens=True)
40
41print("\n=== RESPONSE ===\n")
42print(response).md dataunsloth/mistral-7b-v0.3