Spaces:
Running
Running
IC4T
commited on
Commit
•
4093a3e
1
Parent(s):
cee8bb0
commit
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ from instruct_pipeline import InstructionTextGenerationPipeline
|
|
20 |
from training.generate import load_model_tokenizer_for_generate
|
21 |
from ctransformers import AutoModelForCausalLM
|
22 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
23 |
-
import
|
24 |
# from training.generate import InstructionTextGenerationPipeline, load_model_tokenizer_for_generate
|
25 |
# from googletrans import Translator
|
26 |
# translator = Translator()
|
@@ -68,7 +68,7 @@ match model_type:
|
|
68 |
|
69 |
# llm = AutoModelForCausalLM.from_pretrained(model_path, model_type='dolly-v2')
|
70 |
|
71 |
-
llm =
|
72 |
|
73 |
# llm = HuggingFacePipeline(
|
74 |
# pipeline=InstructionTextGenerationPipeline(
|
|
|
20 |
from training.generate import load_model_tokenizer_for_generate
|
21 |
from ctransformers import AutoModelForCausalLM
|
22 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
23 |
+
from langchain.llms import CTransformers
|
24 |
# from training.generate import InstructionTextGenerationPipeline, load_model_tokenizer_for_generate
|
25 |
# from googletrans import Translator
|
26 |
# translator = Translator()
|
|
|
68 |
|
69 |
# llm = AutoModelForCausalLM.from_pretrained(model_path, model_type='dolly-v2')
|
70 |
|
71 |
+
llm = CTransformers(model_path, callbacks=[StreamingStdOutCallbackHandler()])
|
72 |
|
73 |
# llm = HuggingFacePipeline(
|
74 |
# pipeline=InstructionTextGenerationPipeline(
|