mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
Templates: Switch to Jinja2
Jinja2 is a lightweight template parser that's used in Transformers for parsing chat completions. It's much more efficient than Fastchat and can be imported as part of requirements. Also allows for unblocking Pydantic's version. Users now have to provide their own template if needed. A separate repo may be usable for common prompt template storage. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -25,12 +25,12 @@ else:
|
||||
print("Torch is not found in your environment.")
|
||||
errored_packages.append("torch")
|
||||
|
||||
if find_spec("fastchat") is not None:
|
||||
print(f"Fastchat on version {version('fschat')} successfully imported")
|
||||
successful_packages.append("fastchat")
|
||||
if find_spec("jinja2") is not None:
|
||||
print(f"Jinja2 on version {version('jinja2')} successfully imported")
|
||||
successful_packages.append("jinja2")
|
||||
else:
|
||||
print("Fastchat is not found in your environment. It isn't needed unless you're using chat completions with message arrays.")
|
||||
errored_packages.append("fastchat")
|
||||
print("Jinja2 is not found in your environment.")
|
||||
errored_packages.append("jinja2")
|
||||
|
||||
print(
|
||||
f"\nSuccessful imports: {', '.join(successful_packages)}",
|
||||
|
||||
Reference in New Issue
Block a user