Update app.py
Browse files
app.py
CHANGED
@@ -43,6 +43,24 @@ CHROMA_EXCEL = './chroma/kkg/excel'
|
|
43 |
#HuggingFace Model name--------------------------------
|
44 |
MODEL_NAME_HF = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
# Hugging Face Token direkt im Code setzen
|
47 |
hf_token = os.getenv("HF_READ")
|
48 |
os.environ["HUGGINGFACEHUB_API_TOKEN"] = os.getenv("HF_READ")
|
@@ -187,13 +205,12 @@ def generate_text (prompt, chatbot, history, vektordatenbank, retriever, top_p=0
|
|
187 |
#oder an Hugging Face --------------------------
|
188 |
print("HF Anfrage.......................")
|
189 |
model_kwargs={"temperature": 0.5, "max_length": 512, "num_return_sequences": 1, "top_k": top_k, "top_p": top_p, "repetition_penalty": repetition_penalty}
|
190 |
-
|
191 |
#llm = HuggingFaceChain(model=MODEL_NAME_HF, model_kwargs={"temperature": 0.5, "max_length": 128})
|
192 |
# Erstelle eine Pipeline mit den gewünschten Parametern
|
193 |
-
pipe = pipeline("text-generation", model=MODEL_NAME_HF , model_kwargs=model_kwargs)
|
194 |
-
|
195 |
# Erstelle eine HuggingFacePipeline-Kette
|
196 |
-
llm = HuggingFacePipeline(pipeline=pipe)
|
197 |
|
198 |
#Prompt an history anhängen und einen Text daraus machen
|
199 |
history_text_und_prompt = generate_prompt_with_history(prompt, history)
|
|
|
43 |
#HuggingFace Model name--------------------------------
|
44 |
MODEL_NAME_HF = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
45 |
|
46 |
+
#HuggingFace Reop ID--------------------------------
|
47 |
+
#repo_id = "meta-llama/Llama-2-13b-chat-hf"
|
48 |
+
repo_id = "HuggingFaceH4/zephyr-7b-alpha" #das Modell ist echt gut!!! Vom MIT
|
49 |
+
#repo_id = "TheBloke/Yi-34B-Chat-GGUF"
|
50 |
+
#repo_id = "meta-llama/Llama-2-70b-chat-hf"
|
51 |
+
#repo_id = "tiiuae/falcon-40b"
|
52 |
+
#repo_id = "Vicuna-33b"
|
53 |
+
#repo_id = "alexkueck/ChatBotLI2Klein"
|
54 |
+
#repo_id = "mistralai/Mistral-7B-v0.1"
|
55 |
+
#repo_id = "internlm/internlm-chat-7b"
|
56 |
+
#repo_id = "Qwen/Qwen-7B"
|
57 |
+
#repo_id = "Salesforce/xgen-7b-8k-base"
|
58 |
+
#repo_id = "Writer/camel-5b-hf"
|
59 |
+
#repo_id = "databricks/dolly-v2-3b"
|
60 |
+
#repo_id = "google/flan-t5-xxl"
|
61 |
+
#repo_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
62 |
+
#repo_id = "abacusai/Smaug-72B-v0.1"
|
63 |
+
|
64 |
# Hugging Face Token direkt im Code setzen
|
65 |
hf_token = os.getenv("HF_READ")
|
66 |
os.environ["HUGGINGFACEHUB_API_TOKEN"] = os.getenv("HF_READ")
|
|
|
205 |
#oder an Hugging Face --------------------------
|
206 |
print("HF Anfrage.......................")
|
207 |
model_kwargs={"temperature": 0.5, "max_length": 512, "num_return_sequences": 1, "top_k": top_k, "top_p": top_p, "repetition_penalty": repetition_penalty}
|
208 |
+
llm = HuggingFaceHub(repo_id=repo_id, model_kwargs=model_kwargs)
|
209 |
#llm = HuggingFaceChain(model=MODEL_NAME_HF, model_kwargs={"temperature": 0.5, "max_length": 128})
|
210 |
# Erstelle eine Pipeline mit den gewünschten Parametern
|
211 |
+
#pipe = pipeline("text-generation", model=MODEL_NAME_HF , model_kwargs=model_kwargs)
|
|
|
212 |
# Erstelle eine HuggingFacePipeline-Kette
|
213 |
+
#llm = HuggingFacePipeline(pipeline=pipe)
|
214 |
|
215 |
#Prompt an history anhängen und einen Text daraus machen
|
216 |
history_text_und_prompt = generate_prompt_with_history(prompt, history)
|