Spaces:
Sleeping
Sleeping
VatsalPatel18
commited on
Commit
•
1e237a2
1
Parent(s):
e8ef1da
Update main.py
Browse files
main.py
CHANGED
@@ -5,21 +5,12 @@ from langchain_community.llms import LlamaCpp
|
|
5 |
from langchain.agents import initialize_agent
|
6 |
from functions import get_weather_info, get_forecast, shutdown
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
-
from dotenv import load_dotenv
|
9 |
|
10 |
-
# Load environment variables from .env file
|
11 |
-
load_dotenv()
|
12 |
-
|
13 |
-
# Set custom cache directory
|
14 |
-
cache_dir = "/home/user/app/hf_cache"
|
15 |
-
os.makedirs(cache_dir, exist_ok=True)
|
16 |
|
17 |
# Download the model directly in the app
|
18 |
model_path = hf_hub_download(
|
19 |
-
repo_id=
|
20 |
-
filename=
|
21 |
-
cache_dir=cache_dir
|
22 |
-
)
|
23 |
|
24 |
# Initialize the LlamaCpp model
|
25 |
llm = LlamaCpp(
|
|
|
5 |
from langchain.agents import initialize_agent
|
6 |
from functions import get_weather_info, get_forecast, shutdown
|
7 |
from huggingface_hub import hf_hub_download
|
|
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
# Download the model directly in the app
|
11 |
model_path = hf_hub_download(
|
12 |
+
repo_id="microsoft/Phi-3-mini-4k-instruct-gguf",
|
13 |
+
filename="Phi-3-mini-4k-instruct-q4.gguf"))
|
|
|
|
|
14 |
|
15 |
# Initialize the LlamaCpp model
|
16 |
llm = LlamaCpp(
|