code: def _logit_bias_tokens_to_input_ids(
      llama: llama_cpp.Llama,
      logit_bias: Dict[str, float],
  ) -> Dict[str, float]:
      to_bias: Dict[str, float] = {}
      for token, score in logit_bias.items():
          token = token.encode("utf-8")
          for input_id in llama.tokenize(
              token, add_bos=False, special=True
          ):
              to_bias[str(input_id)] = score
      return to_bias
  
imports: from __future__ import annotations
  import os
  import json
  from threading import Lock
  from functools import partial
  from typing import Iterator, List, Optional, Union, Dict
  import llama_cpp
  import anyio
  from anyio.streams.memory import MemoryObjectSendStream
  from starlette.concurrency import run_in_threadpool, iterate_in_threadpool
  from fastapi import Depends, FastAPI, APIRouter, Request, HTTPException, status
  from fastapi.middleware import Middleware
  from fastapi.middleware.cors import CORSMiddleware
  from fastapi.security import HTTPBearer
  from sse_starlette.sse import EventSourceResponse
  from starlette_context.plugins import RequestIdPlugin
  from starlette_context.middleware import RawContextMiddleware
  from llama_cpp.server.model import LlamaProxy
  from llama_cpp.server.settings import ConfigFileSettings, Settings, ModelSettings, ServerSettings
  from llama_cpp.server.types import CreateCompletionRequest, CreateEmbeddingRequest, CreateChatCompletionRequest, ModelList
  from llama_cpp.server.errors import RouteErrorHandler
label_desc: Use image node_id 6 for calling a global function with example usage: _logit_bias_tokens_to_input_ids(llama, logit_bias) and returns: to_bias