Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -306,12 +306,13 @@ def invoke (prompt, history, rag_option, model_option, openai_api_key, temperat
|
|
| 306 |
if (model_option == "OpenAI"):
|
| 307 |
#Anfrage an OpenAI ----------------------------
|
| 308 |
llm = ChatOpenAI(model_name = MODEL_NAME, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
|
|
|
|
| 309 |
else:
|
| 310 |
#oder an Hugging Face --------------------------
|
| 311 |
llm = HuggingFaceHub(repo_id=repo_id, model_kwargs={"temperature": 0.5, "max_length": 64})
|
| 312 |
#llm = HuggingFaceHub(url_??? = "https://wdgsjd6zf201mufn.us-east-1.aws.endpoints.huggingface.cloud", model_kwargs={"temperature": 0.5, "max_length": 64})
|
| 313 |
#llm = HuggingFaceTextGenInference( inference_server_url="http://localhost:8010/", max_new_tokens=max_new_tokens,top_k=10,top_p=top_p,typical_p=0.95,temperature=temperature,repetition_penalty=repetition_penalty,)
|
| 314 |
-
|
| 315 |
|
| 316 |
#zusätzliche Dokumenten Splits aus DB zum Prompt hinzufügen (aus VektorDB - Chroma oder Mongo DB)
|
| 317 |
if (rag_option == "An"):
|
|
|
|
| 306 |
if (model_option == "OpenAI"):
|
| 307 |
#Anfrage an OpenAI ----------------------------
|
| 308 |
llm = ChatOpenAI(model_name = MODEL_NAME, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
|
| 309 |
+
print("openAI")
|
| 310 |
else:
|
| 311 |
#oder an Hugging Face --------------------------
|
| 312 |
llm = HuggingFaceHub(repo_id=repo_id, model_kwargs={"temperature": 0.5, "max_length": 64})
|
| 313 |
#llm = HuggingFaceHub(url_??? = "https://wdgsjd6zf201mufn.us-east-1.aws.endpoints.huggingface.cloud", model_kwargs={"temperature": 0.5, "max_length": 64})
|
| 314 |
#llm = HuggingFaceTextGenInference( inference_server_url="http://localhost:8010/", max_new_tokens=max_new_tokens,top_k=10,top_p=top_p,typical_p=0.95,temperature=temperature,repetition_penalty=repetition_penalty,)
|
| 315 |
+
print("HF")
|
| 316 |
|
| 317 |
#zusätzliche Dokumenten Splits aus DB zum Prompt hinzufügen (aus VektorDB - Chroma oder Mongo DB)
|
| 318 |
if (rag_option == "An"):
|