@@ -177,22 +177,8 @@ def setup_environment():
177177 process_text .insert (tk .END , "Checking environment...\n " )
178178 root .update ()
179179
180- # Check for GitPython
181- try :
182- from git import Repo
183- process_text .insert (tk .END , "GitPython is already installed.\n " )
184- except ImportError :
185- process_text .insert (tk .END , "Installing GitPython...\n " )
186- root .update ()
187- try :
188- subprocess .check_call ([sys .executable , "-m" , "pip" , "install" , "GitPython" ])
189- process_text .insert (tk .END , "Successfully installed GitPython.\n " )
190- except subprocess .CalledProcessError as e :
191- process_text .insert (tk .END , f"Error installing GitPython: { e } \n " )
192- return False
193-
194- # List of other required packages
195- required_packages = ['torch' , 'tqdm' , 'safetensors' ]
180+ # List of required packages (added 'gguf')
181+ required_packages = ['torch' , 'tqdm' , 'safetensors' , 'gguf' ]
196182
197183 for package in required_packages :
198184 try :
@@ -208,35 +194,6 @@ def setup_environment():
208194 process_text .insert (tk .END , f"Error installing { package } : { e } \n " )
209195 return False
210196
211- # Check if gguf-py is installed
212- gguf_installed = False
213- try :
214- __import__ ('gguf' )
215- process_text .insert (tk .END , "gguf-py is already installed.\n " )
216- gguf_installed = True
217- except ImportError :
218- pass
219-
220- if not gguf_installed :
221- # Clone llama.cpp repository only if gguf-py is not installed
222- if not os .path .exists ("llama.cpp" ):
223- try :
224- Repo .clone_from ("https://github.com/ggerganov/llama.cpp" , "llama.cpp" )
225- process_text .insert (tk .END , "Successfully cloned llama.cpp repository.\n " )
226- except Exception as e :
227- process_text .insert (tk .END , f"Error cloning repository: { e } \n " )
228- return False
229-
230- # Install gguf-py
231- process_text .insert (tk .END , "Installing gguf-py...\n " )
232- root .update ()
233- try :
234- subprocess .check_call ([sys .executable , "-m" , "pip" , "install" , "llama.cpp/gguf-py" ])
235- process_text .insert (tk .END , "Successfully installed gguf-py.\n " )
236- except subprocess .CalledProcessError as e :
237- process_text .insert (tk .END , f"Error installing gguf-py: { e } \n " )
238- return False
239-
240197 process_text .insert (tk .END , "Environment check completed. All dependencies are in place.\n " )
241198 root .update ()
242199 return True
0 commit comments