Missing error upon trying to download nonexistant models #436
Closed
Description
Alpaca 3.2.0, flatpak bundle, on Fedora 41
Describe the bug
On trying to download a model by name that doesn't exist (or exists but ":latest" isn't valid and a flavor isn't specified), the download dialog is stuck on "pulling manifest" forever instead of giving an error.
Expected behavior
I would expect to see an error stating the requested model doesn't exist, perhaps elaborating by saying to add the specific flavor if the model does exist but doesn't have a ":latest".
Debugging information
On such a download attempt, an error does show up in the terminal:
INFO [model_widget.py | pull_model] Pulling model: Foobar:latest
[GIN] 2025/01/02 - 18:58:33 | 200 | 541.614421ms | 127.0.0.1 | POST "/api/pull"
Exception in thread Thread-37 (pull_model):
Traceback (most recent call last):
File "/usr/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
self.run()
File "/usr/lib/python3.12/threading.py", line 1012, in run
self._target(*self._args, **self._kwargs)
File "/app/share/Alpaca/alpaca/custom_widgets/model_widget.py", line 845, in pull_model
response = window.ollama_instance.request("POST", "api/pull", json.dumps({"name": model_name}), lambda data: model.update(data))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/share/Alpaca/alpaca/connection_handler.py", line 83, in request
callback(json.loads(line.decode("utf-8")))
File "/app/share/Alpaca/alpaca/custom_widgets/model_widget.py", line 845, in <lambda>
response = window.ollama_instance.request("POST", "api/pull", json.dumps({"name": model_name}), lambda data: model.update(data))
^^^^^^^^^^^^^^^^^^
File "/app/share/Alpaca/alpaca/custom_widgets/model_widget.py", line 248, in update
GLib.idle_add(self.prc_label.set_label, data['status'])
~~~~^^^^^^^^^^
KeyError: 'status'