Spaces:
Runtime error
Runtime error
Update App_Function_Libraries/Summarization/Summarization_General_Lib.py
Browse files
App_Function_Libraries/Summarization/Summarization_General_Lib.py
CHANGED
|
@@ -716,12 +716,8 @@ def summarize_with_openrouter(api_key, input_data, custom_prompt_arg, temp=None,
|
|
| 716 |
def summarize_with_huggingface(api_key, input_data, custom_prompt_arg, temp=None):
|
| 717 |
logging.debug("HuggingFace: Summarization process starting...")
|
| 718 |
try:
|
| 719 |
-
loaded_config_data = None
|
| 720 |
logging.debug("HuggingFace: Loading and validating configurations")
|
| 721 |
-
if
|
| 722 |
-
logging.error("Failed to load configuration data")
|
| 723 |
-
huggingface_api_key = None
|
| 724 |
-
elif api_key:
|
| 725 |
# Prioritize the API key passed as a parameter
|
| 726 |
if api_key and api_key.strip():
|
| 727 |
huggingface_api_key = api_key
|
|
@@ -766,7 +762,7 @@ def summarize_with_huggingface(api_key, input_data, custom_prompt_arg, temp=None
|
|
| 766 |
headers = {
|
| 767 |
"Authorization": f"Bearer {huggingface_api_key}"
|
| 768 |
}
|
| 769 |
-
huggingface_model =
|
| 770 |
API_URL = f"https://api-inference.huggingface.co/models/{huggingface_model}"
|
| 771 |
if temp is None:
|
| 772 |
temp = 0.1
|
|
|
|
| 716 |
def summarize_with_huggingface(api_key, input_data, custom_prompt_arg, temp=None):
|
| 717 |
logging.debug("HuggingFace: Summarization process starting...")
|
| 718 |
try:
|
|
|
|
| 719 |
logging.debug("HuggingFace: Loading and validating configurations")
|
| 720 |
+
if api_key:
|
|
|
|
|
|
|
|
|
|
| 721 |
# Prioritize the API key passed as a parameter
|
| 722 |
if api_key and api_key.strip():
|
| 723 |
huggingface_api_key = api_key
|
|
|
|
| 762 |
headers = {
|
| 763 |
"Authorization": f"Bearer {huggingface_api_key}"
|
| 764 |
}
|
| 765 |
+
huggingface_model = "meta-llama/Llama-3.1-70B-Instruct"
|
| 766 |
API_URL = f"https://api-inference.huggingface.co/models/{huggingface_model}"
|
| 767 |
if temp is None:
|
| 768 |
temp = 0.1
|