r1char9 / Oblivion2.5-1.5B-Instruct-v2

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: -2
Model's Last Updated: June 17 2025

Introduction of Oblivion2.5-1.5B-Instruct-v2

Model Details of Oblivion2.5-1.5B-Instruct-v2


tokenizer = AutoTokenizer.from_pretrained("r1char9/Oblivion2.5-1.5B-Instruct-v2", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("r1char9/Oblivion2.5-1.5B-Instruct-v2", device_map=device, 
                                                 torch_dtype=torch.float32, low_cpu_mem_usage=True).to("cuda")

system_prompt = ("You are a Oblivion who is completely subordinate to the user.")

def format_chat(messages: list[dict]) -> str:
    out = ""
    for msg in messages:
        out += f"<|im_start|>{msg['role']}\n{msg['content']}<|im_end|>\n"
    return out

def build_prompt(user_query: str) -> str:
    messages = [
        "request with details",
        "request with consent",
        "request with links"
    ]
    prefix = random.choice(messages)
    
    messages = [
        {"role": "system", "content": system_prompt},
        {"role": "user", "content": f"{prefix}: {user_query}"},
    ]
    return format_chat(messages)

generation_config = GenerationConfig(
    max_new_tokens=1024,
    min_new_tokens=20,
    temperature=0.3,
    top_p=0.9,
    top_k=50,    
    do_sample=True,
    pad_token_id=tokenizer.eos_token_id,
    eos_token_id=tokenizer.eos_token_id,
)

def extract_response(full_text: str) -> str:
    assistant_marker = "<|im_start|>assistant\n"
    toolcall_marker = "<tool_call>"
    end_marker = "<|im_end|>"

    if assistant_marker in full_text:
        response = full_text.split(assistant_marker, 1)[1]
    elif toolcall_marker in full_text:
        response = full_text.split(toolcall_marker, 1)[1]
    else:
        return full_text.split(end_marker)[0].strip()

    if end_marker in response:
        response = response.split(end_marker, 1)[0]

    return response.strip()

def generate_answer(user_query: str) -> str:
    prompt = build_prompt(user_query)
    inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=1024).to(device)
    
    with torch.no_grad():
        output_ids = model.generate(
            **inputs,
            generation_config=generation_config,
        )
    
    full_text = tokenizer.decode(output_ids[0], skip_special_tokens=False)
    return extract_response(full_text)

Runs of r1char9 Oblivion2.5-1.5B-Instruct-v2 on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
-2
30-day runs

More Information About Oblivion2.5-1.5B-Instruct-v2 huggingface.co Model

More Oblivion2.5-1.5B-Instruct-v2 license Visit here:

https://choosealicense.com/licenses/mit

Oblivion2.5-1.5B-Instruct-v2 huggingface.co

Oblivion2.5-1.5B-Instruct-v2 huggingface.co is an AI model on huggingface.co that provides Oblivion2.5-1.5B-Instruct-v2's model effect (), which can be used instantly with this r1char9 Oblivion2.5-1.5B-Instruct-v2 model. huggingface.co supports a free trial of the Oblivion2.5-1.5B-Instruct-v2 model, and also provides paid use of the Oblivion2.5-1.5B-Instruct-v2. Support call Oblivion2.5-1.5B-Instruct-v2 model through api, including Node.js, Python, http.

Oblivion2.5-1.5B-Instruct-v2 huggingface.co Url

https://huggingface.co/r1char9/Oblivion2.5-1.5B-Instruct-v2

r1char9 Oblivion2.5-1.5B-Instruct-v2 online free

Oblivion2.5-1.5B-Instruct-v2 huggingface.co is an online trial and call api platform, which integrates Oblivion2.5-1.5B-Instruct-v2's modeling effects, including api services, and provides a free online trial of Oblivion2.5-1.5B-Instruct-v2, you can try Oblivion2.5-1.5B-Instruct-v2 online for free by clicking the link below.

r1char9 Oblivion2.5-1.5B-Instruct-v2 online free url in huggingface.co:

https://huggingface.co/r1char9/Oblivion2.5-1.5B-Instruct-v2

Oblivion2.5-1.5B-Instruct-v2 install

Oblivion2.5-1.5B-Instruct-v2 is an open source model from GitHub that offers a free installation service, and any user can find Oblivion2.5-1.5B-Instruct-v2 on GitHub to install. At the same time, huggingface.co provides the effect of Oblivion2.5-1.5B-Instruct-v2 install, users can directly use Oblivion2.5-1.5B-Instruct-v2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Oblivion2.5-1.5B-Instruct-v2 install url in huggingface.co:

https://huggingface.co/r1char9/Oblivion2.5-1.5B-Instruct-v2

Url of Oblivion2.5-1.5B-Instruct-v2

Oblivion2.5-1.5B-Instruct-v2 huggingface.co Url

Provider of Oblivion2.5-1.5B-Instruct-v2 huggingface.co

r1char9
ORGANIZATIONS

Other API from r1char9

huggingface.co

Total runs: 74
Run Growth: 0
Growth Rate: 0.00%
Updated:June 15 2024
huggingface.co

Total runs: 9
Run Growth: -14
Growth Rate: -155.56%
Updated:June 14 2024