Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
-
from langchain.llms import HuggingFacePipeline
|
3 |
-
from transformers import AutoTokenizer
|
4 |
import transformers
|
5 |
import torch
|
6 |
import warnings
|
7 |
warnings.filterwarnings('ignore')
|
8 |
|
9 |
-
|
|
|
10 |
|
11 |
tokenizer=AutoTokenizer.from_pretrained(model="TheBloke/Llama-2-7B-Chat-GGML", model_file="llama-2-7b-chat.ggmlv3.q3_K_S.bin")
|
12 |
|
13 |
pipeline=transformers.pipeline(
|
14 |
"text-generation",
|
15 |
-
model=
|
16 |
tokenizer=tokenizer,
|
17 |
torch_dtype=torch.bfloat16,
|
18 |
trust_remote_code=True,
|
|
|
1 |
import gradio as gr
|
2 |
+
from langchain.llms import HuggingFacePipeline, CTransformers
|
3 |
+
from transformers import AutoTokenizer, AutoModel
|
4 |
import transformers
|
5 |
import torch
|
6 |
import warnings
|
7 |
warnings.filterwarnings('ignore')
|
8 |
|
9 |
+
model = CTransformers(model="TheBloke/Llama-2-7B-Chat-GGML", model_file="llama-2-7b-chat.ggmlv3.q3_K_S.bin")
|
10 |
+
|
11 |
|
12 |
tokenizer=AutoTokenizer.from_pretrained(model="TheBloke/Llama-2-7B-Chat-GGML", model_file="llama-2-7b-chat.ggmlv3.q3_K_S.bin")
|
13 |
|
14 |
pipeline=transformers.pipeline(
|
15 |
"text-generation",
|
16 |
+
model=model,
|
17 |
tokenizer=tokenizer,
|
18 |
torch_dtype=torch.bfloat16,
|
19 |
trust_remote_code=True,
|