Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -45,18 +45,18 @@ from llama_index.core.agent.workflow import AgentWorkflow
|
|
| 45 |
|
| 46 |
# Initialize model (defaults to llama3.1)
|
| 47 |
def init_model(model:str='llama3.1:8b-instruct-q4_0'):
|
| 48 |
-
from llama_index.llms.ollama import Ollama
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
llm_model = Ollama(
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
|
| 61 |
return llm_model
|
| 62 |
|
|
|
|
| 45 |
|
| 46 |
# Initialize model (defaults to llama3.1)
|
| 47 |
def init_model(model:str='llama3.1:8b-instruct-q4_0'):
|
| 48 |
+
# from llama_index.llms.ollama import Ollama
|
| 49 |
+
from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
|
| 50 |
+
|
| 51 |
+
# llm_model = Ollama(
|
| 52 |
+
# model=model,
|
| 53 |
+
# request_timeout=360.0
|
| 54 |
+
# )
|
| 55 |
+
|
| 56 |
+
llm_model = HuggingFaceInferenceAPI(
|
| 57 |
+
model='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud/'
|
| 58 |
+
# model_name='Qwen/Qwen2.5-Coder-32B-Instruct'
|
| 59 |
+
)
|
| 60 |
|
| 61 |
return llm_model
|
| 62 |
|