Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -13,7 +13,10 @@ load_dotenv()
|
|
| 13 |
sessions_path = "sessions.pkl"
|
| 14 |
sessions = pickle.load(open(sessions_path, "rb")) if os.path.exists(sessions_path) else {}
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
app = None
|
| 19 |
|
|
|
|
| 13 |
sessions_path = "sessions.pkl"
|
| 14 |
sessions = pickle.load(open(sessions_path, "rb")) if os.path.exists(sessions_path) else {}
|
| 15 |
|
| 16 |
+
# If currently hosted on HuggingFace Spaces, use the default model, otherwise use the local model
|
| 17 |
+
model_name = "meta-llama/Meta-Llama-3.1-8B-Instruct" if os.getenv("SPACE_ID") is not None else "http://localhost:1234/v1"
|
| 18 |
+
|
| 19 |
+
agent = get_agent(model_name=model_name, include_image_tools=True)
|
| 20 |
|
| 21 |
app = None
|
| 22 |
|