Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,10 +4,10 @@ from langchain.text_splitter import CharacterTextSplitter
|
|
| 4 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 5 |
from langchain_community.vectorstores import FAISS
|
| 6 |
from langchain.chains import RetrievalQA
|
| 7 |
-
from langchain.llms.base import LLM # Basis-Klasse, um
|
| 8 |
from transformers import pipeline
|
| 9 |
|
| 10 |
-
#
|
| 11 |
class LeoLM(LLM):
|
| 12 |
def __init__(self, max_new_tokens=512, temperature=0.5):
|
| 13 |
self.pipeline = pipeline("text-generation", model="LeoLM/leo-mistral-hessianai-7b")
|
|
|
|
| 4 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 5 |
from langchain_community.vectorstores import FAISS
|
| 6 |
from langchain.chains import RetrievalQA
|
| 7 |
+
from langchain.llms.base import LLM # Basis-Klasse, um einen Wrapper zu erstellen
|
| 8 |
from transformers import pipeline
|
| 9 |
|
| 10 |
+
# LeoLM-Wrapper-Klasse, die das LeoLM-Modell via Transformers-Pipeline nutzt
|
| 11 |
class LeoLM(LLM):
|
| 12 |
def __init__(self, max_new_tokens=512, temperature=0.5):
|
| 13 |
self.pipeline = pipeline("text-generation", model="LeoLM/leo-mistral-hessianai-7b")
|