Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on Mac M1 - due to screen resolution #5

Closed
rahulmanuwas opened this issue Oct 25, 2024 · 4 comments
Closed

error on Mac M1 - due to screen resolution #5

rahulmanuwas opened this issue Oct 25, 2024 · 4 comments

Comments

@rahulmanuwas
Copy link

Screenshot 2024-10-25 at 4 29 32 PM
@Jon-Biz
Copy link

Jon-Biz commented Oct 25, 2024

Same on an x86 Mac.

Traceback (most recent call last):
  File "/Users/Bumpant/Development/computer_use_ootb/.venv/lib/python3.12/site-packages/gradio/queueing.py", line 624, in process_events
    response = await route_utils.call_process_api(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/.venv/lib/python3.12/site-packages/gradio/route_utils.py", line 323, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/.venv/lib/python3.12/site-packages/gradio/blocks.py", line 2018, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/.venv/lib/python3.12/site-packages/gradio/blocks.py", line 1567, in call_function
    prediction = await anyio.to_thread.run_sync(  # type: ignore
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/.venv/lib/python3.12/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/.venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2441, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/.venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 943, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/.venv/lib/python3.12/site-packages/gradio/utils.py", line 846, in wrapper
    response = f(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/app.py", line 189, in process_input
    asyncio.run(sampling_loop_wrapper(state))
  File "/Users/Bumpant/.pyenv/versions/3.12.1/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/Users/Bumpant/.pyenv/versions/3.12.1/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Bumpant/.pyenv/versions/3.12.1/lib/python3.12/asyncio/base_events.py", line 684, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/app.py", line 243, in sampling_loop_wrapper
    await sampling_loop(
  File "/Users/Bumpant/Development/computer_use_ootb/computer_use_demo/loop.py", line 72, in sampling_loop
    ComputerTool(),
    ^^^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/computer_use_demo/tools/computer.py", line 96, in __init__
    self.width, self.height = self.get_screen_size()
                              ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Bumpant/Development/computer_use_ootb/computer_use_demo/tools/computer.py", line 259, in get_screen_size
    width, height = map(int, resolution.split('x'))
    ^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'Resolution:'

@PyroFilmsFX
Copy link

PyroFilmsFX commented Oct 26, 2024

I have fixed this issue and submitted a pull request, you can pull mine for now if desire:
#10

e: correction, you will still need to add some kind of coordinate correction function due to retina 2x the pixel distance. i gave up on this and am just creating my own. much easier.

@KBB99
Copy link

KBB99 commented Oct 29, 2024

Having the same issue. @PyroFilmsFX if you get another version working please let us know.

@h-siyuan
Copy link
Collaborator

Now we have added support for any resolution & resolution scale and multiple displays, you can try the latest version:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants