mirror of https://github.com/leafspark/AutoGGUF
feat(backend): allow setting fetch repository
- add AUTOGGUF_BACKEND_REPO environment variable to set GitHub repo to fetch releases - remove Import Model confirmation - fix error when deleting models from list - add localizations and update README with message
This commit is contained in:
parent
a0d00ab999
commit
93daedc285
|
@ -10,3 +10,4 @@ AUTOGGUF_SERVER=enabled
|
||||||
AUTOGGUF_SERVER_PORT=7001
|
AUTOGGUF_SERVER_PORT=7001
|
||||||
AUTOGGUF_SERVER_API_KEY=
|
AUTOGGUF_SERVER_API_KEY=
|
||||||
AUTOGGUF_LANGUAGE=en-US
|
AUTOGGUF_LANGUAGE=en-US
|
||||||
|
AUTOGGUF_BACKEND_REPO=ggerganov/llama.cpp
|
||||||
|
|
|
@ -121,7 +121,7 @@ ### Windows
|
||||||
pip install -U pyinstaller
|
pip install -U pyinstaller
|
||||||
build RELEASE | DEV
|
build RELEASE | DEV
|
||||||
```
|
```
|
||||||
Find the executable in `build/<type>/dist/AutoGGUF.exe`.
|
Find the executable in `build/<type>/dist/AutoGGUF-x64.exe`.
|
||||||
|
|
||||||
You can also use Nuitka, which may result in a slower build but a faster output executable:
|
You can also use Nuitka, which may result in a slower build but a faster output executable:
|
||||||
```bash
|
```bash
|
||||||
|
@ -139,18 +139,21 @@ ## Localizations
|
||||||
## Issues
|
## Issues
|
||||||
|
|
||||||
- Some inconsistent logging
|
- Some inconsistent logging
|
||||||
|
- Missing translations
|
||||||
|
|
||||||
## Planned Features
|
## Planned Features
|
||||||
|
|
||||||
- Time estimation for quantization
|
- Time estimation for quantization
|
||||||
- Quantization file size estimate
|
- Quantization file size estimate
|
||||||
- Perplexity testing
|
- Perplexity testing
|
||||||
- bitsandbytes (coming soon)
|
- bitsandbytes
|
||||||
|
|
||||||
|
Due to my limited availability and a lack of time, I won't be actively developing new features for this project as much. While I'll continue to publish builds from time to time, I strongly recommend running from source if you want to stay up to date with the latest changes. I'm still committed to keeping dependencies updated weekly and making small maintenance fixes to ensure everything runs smoothly. If you run into any problems or notice issues, please don't hesitate to let me know - I appreciate your feedback and will do my best to address them.
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
- SSL module cannot be found error: Install OpenSSL or run from source using `python src/main.py` with the `run.bat` script (`pip install requests`)
|
- SSL module cannot be found error: Install OpenSSL or run from source using `python src/main.py` with the `run.bat` script (`pip install requests`)
|
||||||
- Check out the [Wiki](https://github.com/leafspark/AutoGGUF/wiki) for advanced usage
|
- Check out the [Wiki](https://github.com/leafspark/AutoGGUF/wiki) for advanced usage and configuration
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
@ -1129,7 +1129,7 @@ def delete_model(self, item):
|
||||||
reply = QMessageBox.question(
|
reply = QMessageBox.question(
|
||||||
self,
|
self,
|
||||||
CONFIRM_DELETE,
|
CONFIRM_DELETE,
|
||||||
DELETE_WARNING.format(model_name),
|
DELETE_MODEL_WARNING.format(model_name),
|
||||||
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No,
|
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No,
|
||||||
QMessageBox.StandardButton.No,
|
QMessageBox.StandardButton.No,
|
||||||
)
|
)
|
||||||
|
@ -1142,7 +1142,7 @@ def delete_model(self, item):
|
||||||
)
|
)
|
||||||
self.logger.info(MODEL_DELETED_SUCCESSFULLY.format(model_name))
|
self.logger.info(MODEL_DELETED_SUCCESSFULLY.format(model_name))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
show_error(self.logger, f"Error deleting model: {e}")
|
show_error(self.logger, ERROR_DELETING_MODEL.format(e))
|
||||||
|
|
||||||
def check_for_updates(self) -> None:
|
def check_for_updates(self) -> None:
|
||||||
try:
|
try:
|
||||||
|
@ -1929,14 +1929,6 @@ def import_model(self) -> None:
|
||||||
show_error(self.logger, INVALID_GGUF_FILE.format(file_name))
|
show_error(self.logger, INVALID_GGUF_FILE.format(file_name))
|
||||||
return
|
return
|
||||||
|
|
||||||
reply = QMessageBox.question(
|
|
||||||
self,
|
|
||||||
CONFIRM_IMPORT,
|
|
||||||
IMPORT_MODEL_CONFIRMATION.format(file_name),
|
|
||||||
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No,
|
|
||||||
QMessageBox.StandardButton.No,
|
|
||||||
)
|
|
||||||
if reply == QMessageBox.StandardButton.Yes:
|
|
||||||
self.imported_models.append(file_path)
|
self.imported_models.append(file_path)
|
||||||
self.load_models()
|
self.load_models()
|
||||||
self.logger.info(MODEL_IMPORTED_SUCCESSFULLY.format(file_name))
|
self.logger.info(MODEL_IMPORTED_SUCCESSFULLY.format(file_name))
|
||||||
|
|
|
@ -415,6 +415,7 @@ def __init__(self):
|
||||||
# Model actions
|
# Model actions
|
||||||
self.CONFIRM_DELETE = "Confirm Delete"
|
self.CONFIRM_DELETE = "Confirm Delete"
|
||||||
self.DELETE_MODEL_WARNING = "Are you sure you want to delete the model: {}?"
|
self.DELETE_MODEL_WARNING = "Are you sure you want to delete the model: {}?"
|
||||||
|
self.ERROR_DELETING_MODEL = "Error deleting model: {}"
|
||||||
self.MODEL_RENAMED_SUCCESSFULLY = "Model renamed successfully."
|
self.MODEL_RENAMED_SUCCESSFULLY = "Model renamed successfully."
|
||||||
self.MODEL_DELETED_SUCCESSFULLY = "Model deleted successfully."
|
self.MODEL_DELETED_SUCCESSFULLY = "Model deleted successfully."
|
||||||
|
|
||||||
|
@ -451,12 +452,17 @@ def __init__(self):
|
||||||
self.HF_REPOSITORY_TYPE = "Repository Type"
|
self.HF_REPOSITORY_TYPE = "Repository Type"
|
||||||
self.UPLOAD_TYPE = "Upload Type"
|
self.UPLOAD_TYPE = "Upload Type"
|
||||||
self.UPLOAD = "Upload"
|
self.UPLOAD = "Upload"
|
||||||
|
self.INFO = "Info"
|
||||||
|
|
||||||
self.EXTRA_COMMAND_ARGUMENTS = "Additional command-line arguments"
|
self.EXTRA_COMMAND_ARGUMENTS = "Additional command-line arguments"
|
||||||
|
|
||||||
self.INFO = "Info"
|
|
||||||
self.COPIED_COMMAND_TO_CLIPBOARD = "Copied command to clipboard:"
|
self.COPIED_COMMAND_TO_CLIPBOARD = "Copied command to clipboard:"
|
||||||
|
|
||||||
|
# Repository
|
||||||
|
self.INVALID_REPOSITORY_FORMAT = (
|
||||||
|
"Invalid repository format. Must be 'owner/repo'"
|
||||||
|
)
|
||||||
|
self.REPO_CANNOT_BE_EMPTY = "Owner and repository name cannot be empty"
|
||||||
|
|
||||||
|
|
||||||
class _French(_Localization):
|
class _French(_Localization):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
25
src/utils.py
25
src/utils.py
|
@ -169,18 +169,35 @@ def download_llama_cpp(self) -> None:
|
||||||
self.download_progress.setValue(0)
|
self.download_progress.setValue(0)
|
||||||
|
|
||||||
|
|
||||||
|
def get_repo_from_env() -> tuple[str, str]:
|
||||||
|
repo = os.getenv("AUTOGGUF_BACKEND_REPO", "ggerganov/llama.cpp")
|
||||||
|
|
||||||
|
if not repo or "/" not in repo:
|
||||||
|
raise ValueError(INVALID_REPOSITORY_FORMAT)
|
||||||
|
|
||||||
|
owner, repo_name = repo.split("/", 1)
|
||||||
|
if not all(part.strip() for part in (owner, repo_name)):
|
||||||
|
raise ValueError(REPO_CANNOT_BE_EMPTY)
|
||||||
|
|
||||||
|
return owner, repo_name
|
||||||
|
|
||||||
|
|
||||||
def refresh_releases(self) -> None:
|
def refresh_releases(self) -> None:
|
||||||
self.logger.info(REFRESHING_LLAMACPP_RELEASES)
|
self.logger.info(REFRESHING_LLAMACPP_RELEASES)
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
owner, repo = get_repo_from_env()
|
||||||
"https://api.github.com/repos/ggerganov/llama.cpp/releases"
|
url = f"https://api.github.com/repos/{owner}/{repo}/releases"
|
||||||
)
|
|
||||||
response.raise_for_status() # Raise an exception for bad status codes
|
response = requests.get(url)
|
||||||
|
response.raise_for_status()
|
||||||
|
|
||||||
releases = response.json()
|
releases = response.json()
|
||||||
self.release_combo.clear()
|
self.release_combo.clear()
|
||||||
for release in releases:
|
for release in releases:
|
||||||
self.release_combo.addItem(release["tag_name"], userData=release)
|
self.release_combo.addItem(release["tag_name"], userData=release)
|
||||||
self.release_combo.currentIndexChanged.connect(self.update_assets)
|
self.release_combo.currentIndexChanged.connect(self.update_assets)
|
||||||
self.update_assets()
|
self.update_assets()
|
||||||
|
except ValueError as e:
|
||||||
|
show_error(self.logger, f"Invalid repository configuration: {str(e)}")
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
show_error(self.logger, ERROR_FETCHING_RELEASES.format(str(e)))
|
show_error(self.logger, ERROR_FETCHING_RELEASES.format(str(e)))
|
||||||
|
|
Loading…
Reference in New Issue