Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,12 @@ from selenium.webdriver.chrome.options import Options
|
|
11 |
from webdriver_manager.chrome import ChromeDriverManager
|
12 |
from huggingface_hub import InferenceClient
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
# Configure logging
|
15 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
16 |
|
@@ -99,7 +105,7 @@ def handle_input(storage_location, url1, url2, scrape_interval, content_type):
|
|
99 |
return TASK_PROMPT.format(task=current_task, history="\n".join(history))
|
100 |
|
101 |
# Define the chat response function
|
102 |
-
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
103 |
|
104 |
def respond(
|
105 |
message,
|
|
|
11 |
from webdriver_manager.chrome import ChromeDriverManager
|
12 |
from huggingface_hub import InferenceClient
|
13 |
|
14 |
+
# Check for Hugging Face API key
|
15 |
+
api_key = os.getenv('access')
|
16 |
+
if not api_key:
|
17 |
+
print("Error: Hugging Face API key not found. Please set the 'access' environment variable.")
|
18 |
+
exit(1)
|
19 |
+
|
20 |
# Configure logging
|
21 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
22 |
|
|
|
105 |
return TASK_PROMPT.format(task=current_task, history="\n".join(history))
|
106 |
|
107 |
# Define the chat response function
|
108 |
+
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta", token=api_key)
|
109 |
|
110 |
def respond(
|
111 |
message,
|