showlab / computer_use_ootb

An out-of-the-box (OOTB) version of Anthropic Claude Computer Use for Windows and macOS
MIT License
700 stars 68 forks source link

error when running on windows #14

Closed aleave closed 6 days ago

aleave commented 3 weeks ago

I first get this warning when launching, but the app does start afterwards:

site-packages\gradio\components\chatbot.py:223: UserWarning: You have not specified a value for thetypeparameter. Defaulting to the 'tuples' format for chatbot messages, but this is deprecated and will be removed in a future version of Gradio. Please set type='messages' instead, which uses openai-style 'role' and 'content' keys.

When I write a prompt and send to the interface I get an error about valid resolution values

Could not retrieve valid resolution values.
Traceback (most recent call last):
  File "C:\Users\averc\miniforge3\Lib\site-packages\gradio\queueing.py", line 624, in process_events
    response = await route_utils.call_process_api(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\averc\miniforge3\Lib\site-packages\gradio\route_utils.py", line 323, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\averc\miniforge3\Lib\site-packages\gradio\blocks.py", line 2018, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\averc\miniforge3\Lib\site-packages\gradio\blocks.py", line 1579, in call_function
    prediction = await utils.async_iteration(iterator)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\averc\miniforge3\Lib\site-packages\gradio\utils.py", line 691, in async_iteration
    return await anext(iterator)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\averc\miniforge3\Lib\site-packages\gradio\utils.py", line 685, in __anext__
    return await anyio.to_thread.run_sync(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\averc\miniforge3\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\averc\miniforge3\Lib\site-packages\anyio\_backends\_asyncio.py", line 2441, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "C:\Users\averc\miniforge3\Lib\site-packages\anyio\_backends\_asyncio.py", line 943, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\averc\miniforge3\Lib\site-packages\gradio\utils.py", line 668, in run_sync_iterator_async
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "C:\Users\averc\miniforge3\Lib\site-packages\gradio\utils.py", line 829, in gen_wrapper
    response = next(iterator)
               ^^^^^^^^^^^^^^
  File "C:\Users\averc\computer_use_ootb\app.py", line 179, in process_input
    for message in sampling_loop(state):
  File "C:\Users\averc\computer_use_ootb\app.py", line 203, in sampling_loop
    for message in accumulate_messages(
  File "C:\Users\averc\computer_use_ootb\app.py", line 189, in accumulate_messages
    for message in sampling_loop_sync(*args, **kwargs):
  File "C:\Users\averc\computer_use_ootb\computer_use_demo\loop.py", line 183, in sampling_loop_sync
    tool_collection = ToolCollection(
                      ^^^^^^^^^^^^^^^
  File "C:\Users\averc\computer_use_ootb\computer_use_demo\tools\collection.py", line 20, in __init__
    self.tool_map = {tool.to_params()["name"]: tool for tool in tools}
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\averc\computer_use_ootb\computer_use_demo\tools\collection.py", line 20, in <dictcomp>
    self.tool_map = {tool.to_params()["name"]: tool for tool in tools}
                     ^^^^^^^^^^^^^^^^
  File "C:\Users\averc\computer_use_ootb\computer_use_demo\tools\computer.py", line 90, in to_params
    return {"name": self.name, "type": self.api_type, **self.options}
                                                        ^^^^^^^^^^^^
  File "C:\Users\averc\computer_use_ootb\computer_use_demo\tools\computer.py", line 80, in options
    width, height = self.scale_coordinates(
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\averc\computer_use_ootb\computer_use_demo\tools\computer.py", line 220, in scale_coordinates
    ratio = self.width / self.height
            ~~~~~~~~~~~^~~~~~~~~~~~~
TypeError: unsupported operand type(s) for /: 'NoneType' and 'NoneType'
h-siyuan commented 6 days ago

This is due to the display configuration not being recognized by the code. Now we have added support for any resolution & resolution scale & multiple displays, you can try the latest version:)