Update app.py
Browse files
app.py
CHANGED
@@ -450,11 +450,11 @@ def generate_text (prompt, chatbot, history, rag_option, model_option, openai_ap
|
|
450 |
#oder an Hugging Face --------------------------
|
451 |
print("HF Anfrage.......................")
|
452 |
model_kwargs={"temperature": 0.5, "max_length": 1024, "num_return_sequences": 1, "top_k": top_k, "top_p": top_p, "repetition_penalty": repetition_penalty}
|
453 |
-
|
454 |
#llm = HuggingFaceHub(url_??? = "https://wdgsjd6zf201mufn.us-east-1.aws.endpoints.huggingface.cloud", model_kwargs={"temperature": 0.5, "max_length": 64})
|
455 |
#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,)
|
456 |
#Mit Inference Endpoint....
|
457 |
-
llm = HuggingFaceEndpoint(endpoint_url=ENDPOINT_URL, task="text-generation",model_kwargs={ "max_new_tokens": 512,"top_k": 50,"temperature": 0.1,"repetition_penalty": 1.03,},)
|
458 |
print("HF")
|
459 |
#Prompt an history anhängen und einen Text daraus machen
|
460 |
history_text_und_prompt = generate_prompt_with_history(prompt, history)
|
|
|
450 |
#oder an Hugging Face --------------------------
|
451 |
print("HF Anfrage.......................")
|
452 |
model_kwargs={"temperature": 0.5, "max_length": 1024, "num_return_sequences": 1, "top_k": top_k, "top_p": top_p, "repetition_penalty": repetition_penalty}
|
453 |
+
llm = HuggingFaceHub(repo_id=repo_id, model_kwargs=model_kwargs)
|
454 |
#llm = HuggingFaceHub(url_??? = "https://wdgsjd6zf201mufn.us-east-1.aws.endpoints.huggingface.cloud", model_kwargs={"temperature": 0.5, "max_length": 64})
|
455 |
#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,)
|
456 |
#Mit Inference Endpoint....
|
457 |
+
#llm = HuggingFaceEndpoint(endpoint_url=ENDPOINT_URL, task="text-generation",model_kwargs={ "max_new_tokens": 512,"top_k": 50,"temperature": 0.1,"repetition_penalty": 1.03,},)
|
458 |
print("HF")
|
459 |
#Prompt an history anhängen und einen Text daraus machen
|
460 |
history_text_und_prompt = generate_prompt_with_history(prompt, history)
|