You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from pydantic import BaseModel
from huggingface_hub import hf_hub_download
from funcchain.model.patches.llamacpp import ChatLlamaCpp
from funcchain import settings, chain
pn.extension()
class Translations(BaseModel):
chinese: str
french: str
spanish: str
def create_translations(text: str) -> Translations:
"""
Translate the given text into three languages.
"""
return chain()
model_path = hf_hub_download(
"TheBloke/OpenHermes-2.5-Mistral-7B-GGUF",
"openhermes-2.5-mistral-7b.Q4_K_M.gguf",
)
llama = ChatLlamaCpp(
model_path=model_path,
n_gpu_layers=-1,
model_kwargs=dict(chat_format="chatml"),
n_ctx=2048,
verbose=False,
)
json_pane = pn.pane.JSON()
create_translations("Teach me how to say `Hello` in three languages!")
Potentially? not sure whether huggingface cpus/memory are strong enough to load local llama models. I think when panel 1.4.0 is released, I want to rework a lot of these examples to reflect best practices.
The text was updated successfully, but these errors were encountered: