Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,13 @@ from textblob import TextBlob
|
|
| 4 |
import json
|
| 5 |
import os
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Directory to store interactions and feedback
|
| 10 |
DATA_DIR = "data"
|
|
@@ -38,7 +44,7 @@ def save_interaction(user_input, chatbot_response, feedback=None):
|
|
| 38 |
"user_input": user_input,
|
| 39 |
"chatbot_response": chatbot_response,
|
| 40 |
"feedback": feedback,
|
| 41 |
-
"timestamp": "2025-02-25
|
| 42 |
}
|
| 43 |
if os.path.exists(INTERACTIONS_FILE):
|
| 44 |
with open(INTERACTIONS_FILE, "r") as file:
|
|
|
|
| 4 |
import json
|
| 5 |
import os
|
| 6 |
|
| 7 |
+
# Get the API token from the environment variable
|
| 8 |
+
api_token = os.getenv('HUGGINGFACEHUB_API_TOKEN')
|
| 9 |
+
|
| 10 |
+
client = InferenceClient(
|
| 11 |
+
model="Futuresony/future_ai_12_10_2024.gguf",
|
| 12 |
+
token=api_token
|
| 13 |
+
)
|
| 14 |
|
| 15 |
# Directory to store interactions and feedback
|
| 16 |
DATA_DIR = "data"
|
|
|
|
| 44 |
"user_input": user_input,
|
| 45 |
"chatbot_response": chatbot_response,
|
| 46 |
"feedback": feedback,
|
| 47 |
+
"timestamp": "2025-02-25 14:08:31"
|
| 48 |
}
|
| 49 |
if os.path.exists(INTERACTIONS_FILE):
|
| 50 |
with open(INTERACTIONS_FILE, "r") as file:
|