Coool2 commited on
Commit
25b9c20
·
1 Parent(s): 5aecaaa

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +11 -15
agent.py CHANGED
@@ -35,6 +35,7 @@ from llama_index.tools.duckduckgo import DuckDuckGoSearchToolSpec
35
  from llama_index.core.agent.workflow import AgentWorkflow
36
  from llama_index.llms.vllm import Vllm
37
 
 
38
  # Import all required official LlamaIndex Readers
39
  from llama_index.readers.file import (
40
  PDFReader,
@@ -119,21 +120,16 @@ def initialize_models(use_api_mode=False):
119
  print("Initializing models in non-API mode with local models...")
120
 
121
  try :
122
- proj_llm = HuggingFaceLLM(
123
- model_name="google/gemma-3-12b-it",
124
- tokenizer_name="google/gemma-3-12b-it",
125
- device_map="auto",
126
- max_new_tokens=16000,
127
- model_kwargs={
128
- "torch_dtype": "auto",
129
- "max_memory": max_mem, # Add this line
130
- },
131
- generate_kwargs={
132
- "temperature": 0.6,
133
- "top_p": 0.95,
134
- "top_k": 20
135
- }
136
- )
137
 
138
  # Code LLM
139
  code_llm = HuggingFaceLLM(
 
35
  from llama_index.core.agent.workflow import AgentWorkflow
36
  from llama_index.llms.vllm import Vllm
37
 
38
+
39
  # Import all required official LlamaIndex Readers
40
  from llama_index.readers.file import (
41
  PDFReader,
 
120
  print("Initializing models in non-API mode with local models...")
121
 
122
  try :
123
+ proj_llm = HuggingFaceMultiModal.from_model_name(
124
+ "Qwen/Qwen2.5-VL-7B-Instruct",
125
+ temperature=0.7,
126
+ top_p=0.9,
127
+ top_k=40,
128
+ max_new_tokens=5120,
129
+ device_map="auto",
130
+ model_kwargs={"torch_dtype": "auto"}
131
+ )
132
+
 
 
 
 
 
133
 
134
  # Code LLM
135
  code_llm = HuggingFaceLLM(