File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import re
33from pydantic .dataclasses import dataclass
44import os
5- from typing import Optional , TypedDict , Union
5+ from typing import Optional
66import sqlite3
77import json
88from stressed_cyrillic_tools import (
2020 WIZARD_VICUNA7B_PATH ,
2121 WIZARDVICUNA7B_PROMPT ,
2222)
23- from llama_cpp import Llama
2423from russian_text_stresser .russian_dictionary import RussianDictionary
2524from pydantic .json import pydantic_encoder
2625import traceback
@@ -67,6 +66,8 @@ class LLM:
6766
6867class LocalLLM :
6968 def __init__ (self , llm : LLM ):
69+ from llama_cpp import Llama
70+
7071 self .llm = Llama (
7172 model_path = llm .path ,
7273 n_ctx = 1024 , # Some tasks are too long for the default 512 context window
Original file line number Diff line number Diff line change 11#from langchain.llms import LlamaCpp, HuggingFacePipeline
22#from langchain.prompts import PromptTemplate
3- from llama_cpp import Llama
43
54WIZARDVICUNA7B_PROMPT = """### Instruction: {question}
65
1918Saiga: """
2019
2120def test_cpp ():
21+ from llama_cpp import Llama
22+
2223 llm = Llama (
2324 model_path = MANTICORE13B_PATH ,
2425 n_ctx = 2048 ,
@@ -27,6 +28,8 @@ def test_cpp():
2728 print (llm (request ))
2829
2930def test_saiga ():
31+ from llama_cpp import Llama
32+
3033 llm = Llama (
3134 model_path = SAIGA7B_PATH ,
3235 )
You can’t perform that action at this time.
0 commit comments