Text Generation
Transformers
Safetensors
English
qwen3_5_text
qwen3.5
tinyllama
riscv
int4
in-weights
compiled-weights
exact-arithmetic
qwenti
conversational
Instructions to use OpceanAI/qwenti-inference with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpceanAI/qwenti-inference with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpceanAI/qwenti-inference") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpceanAI/qwenti-inference") model = AutoModelForCausalLM.from_pretrained("OpceanAI/qwenti-inference", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpceanAI/qwenti-inference with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpceanAI/qwenti-inference" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpceanAI/qwenti-inference", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OpceanAI/qwenti-inference
- SGLang
How to use OpceanAI/qwenti-inference with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "OpceanAI/qwenti-inference" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpceanAI/qwenti-inference", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "OpceanAI/qwenti-inference" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpceanAI/qwenti-inference", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use OpceanAI/qwenti-inference with Docker Model Runner:
docker model run hf.co/OpceanAI/qwenti-inference
File size: 2,178 Bytes
2049fc8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | import collections
import copy
import os
import subprocess
import sys
import time
os.environ.setdefault("CHIPFORMER_WROM_HEADS", "320")
sys.path.insert(0, "/tmp/opencode/qp/experimental/riscv")
from chipformer.q35 import ir
from chipformer.rv import core, elf, ref
from chipformer.rv import spec as S
path, where, ntok = sys.argv[1], sys.argv[2], int(sys.argv[3])
syms = {}
for line in subprocess.run(["llvm-nm", path], capture_output=True, text=True).stdout.splitlines():
parts = line.split()
if len(parts) == 3:
syms[parts[2]] = int(parts[0], 16)
m = ref.Machine.from_program(elf.program(path))
dump = lambda i: m.ram[0xE000 // 4 + i]
def op_at(mm):
if mm.n == S.N_MAX:
return None
return ref.decode(mm.rom[(mm.pc - S.ROM_BASE) >> 2]).op
def advance(pred):
while not m.halted and not pred():
m.record()
assert not m.halted, "el programa termino antes del punto de control"
if where == "start":
pass
elif where == "bank":
advance(lambda: m.bank >= 1)
elif where == "down":
advance(lambda: m.pc == syms["vk_8_init_raw"])
elif where == "pos1_attn":
advance(lambda: dump(100) != 0)
advance(lambda: op_at(m) == "SMAQA")
elif where == "head_bank":
advance(lambda: dump(30) != 0)
b0 = m.bank
advance(lambda: m.bank != b0)
print(f"punto de control {where}: instrucciones ejecutadas {m.steps}, pc {m.pc:#x}, banco {m.bank}, wb {m.wb}", flush=True)
ref_m = copy.deepcopy(m)
mix = collections.Counter()
toks = [S.tok("GO")]
while len(toks) < ntok and not ref_m.halted:
mix[op_at(ref_m)] += 1
toks += ref_m.record()
print("mezcla de instrucciones del tramo:", dict(mix.most_common(14)), flush=True)
t0 = time.time()
c = core.build()
core.snapshot(c, m)
mat = ir.evaluate(c, toks, check=True)
pred = core.predictions(c, mat)
bad = [(i, S.name(toks[i + 1]), pred[i]) for i in range(len(toks) - 1) if pred[i] != toks[i + 1]]
fams = collections.Counter(S.family(t)[0] for t in toks)
print(f"tokens {len(toks)}, tokens WB {fams['WB']}, WBB {fams['WBB']}, desacuerdos {len(bad)}, {time.time() - t0:.0f}s", flush=True)
print("CIRCUITO == REFERENCIA" if not bad else f"FALLA: {bad[:5]}", flush=True)
|