Skip to content

Commit 681707a

Browse files
committed
Fix imports even more
1 parent f77c5ed commit 681707a

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

russian_text_stresser/gpt3_WSD.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import re
33
from pydantic.dataclasses import dataclass
44
import os
5-
from typing import Optional, TypedDict, Union
5+
from typing import Optional
66
import sqlite3
77
import json
88
from stressed_cyrillic_tools import (
@@ -20,7 +20,6 @@
2020
WIZARD_VICUNA7B_PATH,
2121
WIZARDVICUNA7B_PROMPT,
2222
)
23-
from llama_cpp import Llama
2423
from russian_text_stresser.russian_dictionary import RussianDictionary
2524
from pydantic.json import pydantic_encoder
2625
import traceback
@@ -67,6 +66,8 @@ class LLM:
6766

6867
class 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

russian_text_stresser/llm_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#from langchain.llms import LlamaCpp, HuggingFacePipeline
22
#from langchain.prompts import PromptTemplate
3-
from llama_cpp import Llama
43

54
WIZARDVICUNA7B_PROMPT = """### Instruction: {question}
65
@@ -19,6 +18,8 @@
1918
Saiga: """
2019

2120
def 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

2930
def test_saiga():
31+
from llama_cpp import Llama
32+
3033
llm = Llama(
3134
model_path=SAIGA7B_PATH,
3235
)

0 commit comments

Comments
 (0)