Spaces:
Runtime error
Runtime error
storresbusquets
commited on
Commit
•
ad3b6bf
1
Parent(s):
31eb124
Update app.py
Browse files
app.py
CHANGED
@@ -8,9 +8,6 @@ from wordcloud import WordCloud
|
|
8 |
import re
|
9 |
import os
|
10 |
import transformers
|
11 |
-
from langchain.llms import CTransformers
|
12 |
-
from langchain import PromptTemplate, LLMChain
|
13 |
-
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
14 |
|
15 |
|
16 |
class GradioInference:
|
@@ -48,10 +45,6 @@ class GradioInference:
|
|
48 |
# Initialize Multilingual summary model
|
49 |
self.tokenizer = AutoTokenizer.from_pretrained("csebuetnlp/mT5_multilingual_XLSum", truncation=True)
|
50 |
self.model = AutoModelForSeq2SeqLM.from_pretrained("csebuetnlp/mT5_multilingual_XLSum")
|
51 |
-
|
52 |
-
self.config = {'repetition_penalty': 1.1, 'temperature':0}
|
53 |
-
self.llm = CTransformers(model="TheBloke/Llama-2-7B-Chat-GGML", model_file = 'llama-2-7b-chat.ggmlv3.q2_K.bin', config=self.config,callbacks=[StreamingStdOutCallbackHandler()])
|
54 |
-
|
55 |
|
56 |
def __call__(self, link, lang, size, progress=gr.Progress()):
|
57 |
"""
|
|
|
8 |
import re
|
9 |
import os
|
10 |
import transformers
|
|
|
|
|
|
|
11 |
|
12 |
|
13 |
class GradioInference:
|
|
|
45 |
# Initialize Multilingual summary model
|
46 |
self.tokenizer = AutoTokenizer.from_pretrained("csebuetnlp/mT5_multilingual_XLSum", truncation=True)
|
47 |
self.model = AutoModelForSeq2SeqLM.from_pretrained("csebuetnlp/mT5_multilingual_XLSum")
|
|
|
|
|
|
|
|
|
48 |
|
49 |
def __call__(self, link, lang, size, progress=gr.Progress()):
|
50 |
"""
|