diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/__pycache__/app.cpython-311.pyc b/__pycache__/app.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c6c9fdec82bcf53b765e1b6e5c246c9ebf06a0cc
Binary files /dev/null and b/__pycache__/app.cpython-311.pyc differ
diff --git a/app.py b/app.py
new file mode 100644
index 0000000000000000000000000000000000000000..308be2c61eb5f9565054c675398635187976bc1c
--- /dev/null
+++ b/app.py
@@ -0,0 +1,113 @@
+import sys
+import os
+import argparse
+import time
+import subprocess
+
+
+# subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-e','.'])
+
+import llava.serve.gradio_web_server as gws
+
+# Execute the pip install command with additional options
+
+
+subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'flash-attn', '--no-build-isolation', '-U'])
+
+
+def start_controller():
+ print("Starting the controller")
+ controller_command = [
+ sys.executable,
+ "-m",
+ "llava.serve.controller",
+ "--host",
+ "0.0.0.0",
+ "--port",
+ "10000",
+ ]
+ print(controller_command)
+ return subprocess.Popen(controller_command)
+
+
+def start_worker(model_path: str, bits=4):
+ print(f"Starting the model worker for the model {model_path}")
+ model_name = model_path.strip("/").split("/")[-1]
+ assert bits in [4, 8, 16], "It can be only loaded with 16-bit, 8-bit, and 4-bit."
+ if bits != 16:
+ model_name += f"-{bits}bit"
+ worker_command = [
+ sys.executable,
+ "-m",
+ "llava.serve.model_worker",
+ "--host",
+ "0.0.0.0",
+ "--controller",
+ "http://localhost:10000",
+ "--model-path",
+ model_path,
+ "--model-name",
+ 'llava-v1.5-UGround_v1',
+ "--use-flash-attn",
+ ]
+ if bits != 16:
+ worker_command += [f"--load-{bits}bit"]
+ print(worker_command)
+ return subprocess.Popen(worker_command)
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--host", type=str, default="0.0.0.0")
+ parser.add_argument("--port", type=int)
+ parser.add_argument("--controller-url", type=str, default="http://localhost:10000")
+ parser.add_argument("--concurrency-count", type=int, default=1)
+ parser.add_argument("--model-list-mode", type=str, default="reload", choices=["once", "reload"])
+ parser.add_argument("--share", action="store_true")
+ parser.add_argument("--moderate", action="store_true")
+ parser.add_argument("--embed", action="store_true")
+ gws.args = parser.parse_args()
+ gws.models = []
+
+ gws.title_markdown += """
+This is a demo for UGround from *Navigating the Digital World as Humans Do: Universal Visual Grounding for GUI Agents*. We load the 4bit model by default.
+"""
+
+ print(f"args: {gws.args}")
+
+ # model_path = os.getenv("model", "osunlp/UGround")
+ model_path = "osunlp/UGround"
+ # "osunlp/UGround"
+ bits = int(os.getenv("bits", 4))
+ concurrency_count = int(os.getenv("concurrency_count", 1))
+
+ controller_proc = start_controller()
+ worker_proc = start_worker(model_path, bits=bits)
+
+ # Wait for worker and controller to start
+ time.sleep(10)
+
+ exit_status = 0
+ try:
+ demo = gws.build_demo(embed_mode=False, cur_dir='./', concurrency_count=concurrency_count)
+ demo.queue(
+ status_update_rate=10,
+ api_open=False
+ ).launch(
+ server_name=gws.args.host,
+ server_port=gws.args.port,
+ share=gws.args.share
+ )
+
+ except Exception as e:
+ print(e)
+ exit_status = 1
+ finally:
+ worker_proc.kill()
+ controller_proc.kill()
+
+ sys.exit(exit_status)
+
+
+#preload_from_hub:
+# - "osunlp/UGround"
\ No newline at end of file
diff --git a/controller.log b/controller.log
new file mode 100644
index 0000000000000000000000000000000000000000..5fa7228a770cd4637042726e1eeb503cea9a66ec
--- /dev/null
+++ b/controller.log
@@ -0,0 +1,81 @@
+2024-10-09 14:33:33 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:33:33 | INFO | controller | Init controller
+2024-10-09 14:33:33 | ERROR | stderr | [32mINFO[0m: Started server process [[36m67560[0m]
+2024-10-09 14:33:33 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:33:33 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:33:33 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
+2024-10-09 14:34:27 | ERROR | stderr | [32mINFO[0m: Shutting down
+2024-10-09 14:34:27 | ERROR | stderr | [32mINFO[0m: Waiting for application shutdown.
+2024-10-09 14:34:27 | ERROR | stderr | [32mINFO[0m: Application shutdown complete.
+2024-10-09 14:34:27 | ERROR | stderr | [32mINFO[0m: Finished server process [[36m67560[0m]
+2024-10-09 14:34:36 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:34:36 | INFO | controller | Init controller
+2024-10-09 14:34:36 | ERROR | stderr | [32mINFO[0m: Started server process [[36m67981[0m]
+2024-10-09 14:34:36 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:34:36 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:34:36 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
+2024-10-09 14:38:20 | ERROR | stderr | [32mINFO[0m: Shutting down
+2024-10-09 14:38:21 | ERROR | stderr | [32mINFO[0m: Waiting for application shutdown.
+2024-10-09 14:38:21 | ERROR | stderr | [32mINFO[0m: Application shutdown complete.
+2024-10-09 14:38:21 | ERROR | stderr | [32mINFO[0m: Finished server process [[36m67981[0m]
+2024-10-09 14:38:29 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:38:29 | INFO | controller | Init controller
+2024-10-09 14:38:29 | ERROR | stderr | [32mINFO[0m: Started server process [[36m68570[0m]
+2024-10-09 14:38:29 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:38:29 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:38:29 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
+2024-10-09 14:39:53 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:39:53 | INFO | controller | Init controller
+2024-10-09 14:39:53 | ERROR | stderr | [32mINFO[0m: Started server process [[36m68631[0m]
+2024-10-09 14:39:53 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:39:53 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:39:53 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
+2024-10-09 14:39:59 | INFO | stdout | [32mINFO[0m: 127.0.0.1:58494 - "[1mGET / HTTP/1.1[0m" [31m404 Not Found[0m
+2024-10-09 14:40:33 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:40:33 | INFO | controller | Init controller
+2024-10-09 14:40:33 | ERROR | stderr | [32mINFO[0m: Started server process [[36m68681[0m]
+2024-10-09 14:40:33 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:40:33 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:40:33 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
+2024-10-09 14:40:41 | INFO | stdout | [32mINFO[0m: 127.0.0.1:58574 - "[1mGET / HTTP/1.1[0m" [31m404 Not Found[0m
+2024-10-09 14:47:47 | ERROR | stderr | [32mINFO[0m: Shutting down
+2024-10-09 14:47:48 | ERROR | stderr | [32mINFO[0m: Waiting for application shutdown.
+2024-10-09 14:47:48 | ERROR | stderr | [32mINFO[0m: Application shutdown complete.
+2024-10-09 14:47:48 | ERROR | stderr | [32mINFO[0m: Finished server process [[36m68681[0m]
+2024-10-09 14:47:54 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:47:54 | INFO | controller | Init controller
+2024-10-09 14:47:54 | ERROR | stderr | [32mINFO[0m: Started server process [[36m69107[0m]
+2024-10-09 14:47:54 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:47:54 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:47:54 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
+2024-10-09 14:48:02 | INFO | stdout | [32mINFO[0m: 127.0.0.1:59180 - "[1mGET / HTTP/1.1[0m" [31m404 Not Found[0m
+2024-10-09 14:50:56 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:50:56 | INFO | controller | Init controller
+2024-10-09 14:50:56 | ERROR | stderr | [32mINFO[0m: Started server process [[36m69357[0m]
+2024-10-09 14:50:56 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:50:56 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:50:56 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
+2024-10-09 14:51:43 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:51:43 | INFO | controller | Init controller
+2024-10-09 14:51:43 | ERROR | stderr | [32mINFO[0m: Started server process [[36m69433[0m]
+2024-10-09 14:51:43 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:51:43 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:51:43 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
+2024-10-09 14:53:04 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:53:04 | INFO | controller | Init controller
+2024-10-09 14:53:04 | ERROR | stderr | [32mINFO[0m: Started server process [[36m69542[0m]
+2024-10-09 14:53:04 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:53:04 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:53:04 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
+2024-10-09 14:53:57 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:53:57 | INFO | controller | Init controller
+2024-10-09 14:53:57 | ERROR | stderr | [32mINFO[0m: Started server process [[36m69660[0m]
+2024-10-09 14:53:57 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:53:57 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:53:57 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
+2024-10-09 14:54:37 | INFO | controller | args: Namespace(host='0.0.0.0', port=10000, dispatch_method='shortest_queue')
+2024-10-09 14:54:37 | INFO | controller | Init controller
+2024-10-09 14:54:37 | ERROR | stderr | [32mINFO[0m: Started server process [[36m69742[0m]
+2024-10-09 14:54:37 | ERROR | stderr | [32mINFO[0m: Waiting for application startup.
+2024-10-09 14:54:37 | ERROR | stderr | [32mINFO[0m: Application startup complete.
+2024-10-09 14:54:37 | ERROR | stderr | [32mINFO[0m: Uvicorn running on [1mhttp://0.0.0.0:10000[0m (Press CTRL+C to quit)
diff --git a/data/prompts/complex_reasoning/000_caps.txt b/data/prompts/complex_reasoning/000_caps.txt
new file mode 100644
index 0000000000000000000000000000000000000000..358155c384a2d18e6927d62562ac3f12eef36a87
--- /dev/null
+++ b/data/prompts/complex_reasoning/000_caps.txt
@@ -0,0 +1,18 @@
+A man wearing multiple neck ties making a goofy face.
+A man in a white shirt wearing very many ties.
+a man with ties on poses for a picture
+A man wearing multiple ties on his neck.
+A young man smiles while wearing several ties.
+
+tie: [0.574, 0.298, 0.752, 0.704]
+tie: [0.464, 0.339, 0.639, 0.789]
+tie: [0.349, 0.363, 0.563, 0.732]
+tie: [0.259, 0.255, 0.668, 0.805]
+person: [0.019, 0.065, 0.962, 0.988]
+person: [0.0, 0.24, 0.214, 1.0]
+tie: [0.316, 0.778, 0.443, 0.867]
+tie: [0.386, 0.707, 0.496, 0.801]
+tie: [0.251, 0.354, 0.402, 0.747]
+tie: [0.44, 0.318, 0.63, 0.397]
+tie: [0.566, 0.33, 0.655, 0.543]
+tie: [0.25, 0.409, 0.359, 0.556]
\ No newline at end of file
diff --git a/data/prompts/complex_reasoning/000_conv.txt b/data/prompts/complex_reasoning/000_conv.txt
new file mode 100644
index 0000000000000000000000000000000000000000..04f47a91a74af9ba5686107fb6a4441117494a56
--- /dev/null
+++ b/data/prompts/complex_reasoning/000_conv.txt
@@ -0,0 +1,5 @@
+Question:
+What is unusual about this photo?
+===
+Answer:
+In the photo, the man is wearing a total of ten ties around his neck. This is considered unusual because it is not common for someone to wear multiple ties at once. In a typical setting, a person would wear only one tie. The man's goofy facial expression also adds to the unconventional and humorous nature of the image.
\ No newline at end of file
diff --git a/data/prompts/complex_reasoning/001_caps.txt b/data/prompts/complex_reasoning/001_caps.txt
new file mode 100644
index 0000000000000000000000000000000000000000..2065dfb20a6e40128749d507ecc27d01349e2ad9
--- /dev/null
+++ b/data/prompts/complex_reasoning/001_caps.txt
@@ -0,0 +1,18 @@
+A group of people standing outside of a black vehicle with various luggage.
+Luggage surrounds a vehicle in an underground parking area
+People try to fit all of their luggage in an SUV.
+The sport utility vehicle is parked in the public garage, being packed for a trip
+Some people with luggage near a van that is transporting it.
+
+person: [0.681, 0.242, 0.774, 0.694]
+person: [0.63, 0.222, 0.686, 0.516]
+person: [0.444, 0.233, 0.487, 0.34]
+backpack: [0.384, 0.696, 0.485, 0.914]
+backpack: [0.755, 0.413, 0.846, 0.692]
+suitcase: [0.758, 0.413, 0.845, 0.69]
+suitcase: [0.1, 0.497, 0.173, 0.579]
+bicycle: [0.282, 0.363, 0.327, 0.442]
+car: [0.786, 0.25, 0.848, 0.322]
+car: [0.783, 0.27, 0.827, 0.335]
+car: [0.86, 0.254, 0.891, 0.3]
+car: [0.261, 0.101, 0.787, 0.626]
\ No newline at end of file
diff --git a/data/prompts/complex_reasoning/001_conv.txt b/data/prompts/complex_reasoning/001_conv.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b293aecb87839015f8ab37943afe71c2f8904871
--- /dev/null
+++ b/data/prompts/complex_reasoning/001_conv.txt
@@ -0,0 +1,5 @@
+Question:
+What challenges do these people face?
+===
+Answer:
+In the image, a group of people is standing outside a black SUV in a parking area, surrounded by various pieces of luggage, including suitcases and backpacks. They are facing the challenge of fitting all their luggage into the black SUV. There are multiple suitcases and backpacks to be packed, which suggests that the group has a significant amount of belongings to accommodate. They might have to strategize and arrange the luggage efficiently to ensure that everything fits properly into the vehicle. Additionally, they need to consider the comfort of the passengers and visibility while driving, so the placement of the luggage must not obstruct the driver's view or make the passengers uncomfortable during the trip.
\ No newline at end of file
diff --git a/data/prompts/complex_reasoning/002_caps.txt b/data/prompts/complex_reasoning/002_caps.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8fb59f2eb46c7e0db50d2994b2e9102d46def656
--- /dev/null
+++ b/data/prompts/complex_reasoning/002_caps.txt
@@ -0,0 +1,7 @@
+There is a movie theater that displays the show times above the doors.
+A red fire hydrant is deep in the snow.
+The fire hydrant is in the snow near a recently plowed sidewalk.
+This city has had a very hard winter with snow.
+A hotel for dogs in the snow in winter.
+
+fire hydrant: [0.326, 0.612, 0.426, 0.72]
\ No newline at end of file
diff --git a/data/prompts/complex_reasoning/002_conv.txt b/data/prompts/complex_reasoning/002_conv.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8a2c7f35b9fe3961f0d974ee4799fa517922df83
--- /dev/null
+++ b/data/prompts/complex_reasoning/002_conv.txt
@@ -0,0 +1,5 @@
+Question:
+What challenges might this city face?
+===
+Answer:
+The city faces challenges due to the harsh winter conditions and heavy snowfall. In the image, a red fire hydrant is almost buried deep in the snow, which indicates the significant amount of snow the city has experienced. This can lead to various challenges such as difficulties in transportation, increased risk of accidents, and disruptions to daily life. For example, the recently plowed sidewalk near the fire hydrant shows that the city has to constantly clear snow from roads and sidewalks to maintain access and safety for pedestrians and vehicles. Moreover, emergency services, like firefighters, might face challenges accessing crucial equipment, such as fire hydrants, during emergencies due to the snow accumulation. This highlights the importance of effective snow management strategies and preparedness in such cities to minimize the impact of harsh winter conditions on residents and essential services.
\ No newline at end of file
diff --git a/data/prompts/complex_reasoning/system_message.txt b/data/prompts/complex_reasoning/system_message.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a394efd653554ce687ab8f0c908238bef4f27dee
--- /dev/null
+++ b/data/prompts/complex_reasoning/system_message.txt
@@ -0,0 +1,10 @@
+You are an AI visual assistant that can analyze a single image. You receive five sentences, each describing the same image you are observing. In addition, specific object locations within the image are given, along with detailed coordinates. These coordinates are in the form of bounding boxes, represented as (x1, y1, x2, y2) with floating numbers ranging from 0 to 1. These values correspond to the top left x, top left y, bottom right x, and bottom right y.
+
+The task is to use the provided caption and bounding box information, create a plausible question about the image, and provide the answer in detail.
+
+Create complex questions beyond describing the scene.
+To answer such questions, one should require first understanding the visual content, then based on the background knowledge or reasoning, either explain why the things are happening that way, or provide guides and help to user's request. Make the question challenging by not including the visual content details in the question so that the user needs to reason about that first.
+
+Instead of directly mentioning the bounding box coordinates, utilize this data to explain the scene using natural language. Include details like object counts, position of the objects, relative position between the objects.
+
+When using the information from the caption and coordinates, directly explain the scene, and do not mention that the information source is the caption or the bounding box. Always answer as if you are directly looking at the image.
\ No newline at end of file
diff --git a/data/prompts/conversation/000_caps.txt b/data/prompts/conversation/000_caps.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3139b31b27e6e67b31b27cf0ac7bda317f46d6b8
--- /dev/null
+++ b/data/prompts/conversation/000_caps.txt
@@ -0,0 +1,5 @@
+There is a movie theater that displays the show times above the doors.
+A red fire hydrant is deep in the snow.
+The fire hydrant is in the snow near a recently plowed sidewalk.
+This city has had a very hard winter with snow.
+A hotel for dogs in the snow in winter.
\ No newline at end of file
diff --git a/data/prompts/conversation/000_conv.txt b/data/prompts/conversation/000_conv.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1300cd49992d8c342396cebfebc592909d6391e4
--- /dev/null
+++ b/data/prompts/conversation/000_conv.txt
@@ -0,0 +1,29 @@
+Question:
+What color is the fire hydrant in the image?
+===
+Answer:
+The fire hydrant in the image is red.
+===
+Question:
+Is the fire hydrant fully covered by snow or partially visible?
+===
+Answer:
+The fire hydrant is partially visible, with a significant portion of it covered by the deep snow.
+===
+Question:
+What is the condition of the sidewalk near the fire hydrant?
+===
+Answer:
+The sidewalk near the fire hydrant has been recently plowed, so it is relatively clear of snow compared to the surrounding area.
+===
+Question:
+What does the image suggest about the winter season in the city?
+===
+Answer:
+The image suggests that the winter season in the city has been quite harsh and challenging. The significant snow accumulation seen in the image indicates that the city has experienced heavy snowfall, which can lead to various difficulties and disruptions for its residents.
+
+For instance, the deep snow covering the fire hydrant could potentially hinder its accessibility in case of emergencies, which poses safety concerns. The recently plowed sidewalk implies that the city's maintenance crews have been actively working to keep the walkways clear and safe for pedestrians, but the sheer amount of snowfall might make it difficult to keep up with the continuous snow removal efforts.
+
+Furthermore, such extreme winter conditions can impact transportation, leading to traffic issues, delays in public transit, and increased risks of accidents due to slippery roads. It can also cause problems for businesses and schools, as people might face challenges commuting to work or attending classes. Additionally, the heavy snow can put extra strain on infrastructure, such as roofs and power lines, increasing the likelihood of structural damage or power outages.
+
+In conclusion, the image of the red fire hydrant deep in the snow and the recently plowed sidewalk suggest that the city has faced a particularly severe winter season, with substantial snowfall that has likely caused various challenges and disruptions for its residents and infrastructure.
\ No newline at end of file
diff --git a/data/prompts/conversation/001_caps.txt b/data/prompts/conversation/001_caps.txt
new file mode 100644
index 0000000000000000000000000000000000000000..02a8c6d8dda4f5ac338983251adcdc1d3a99a3f3
--- /dev/null
+++ b/data/prompts/conversation/001_caps.txt
@@ -0,0 +1,5 @@
+A man is skiing in the open snow covered hills
+A skier is making his way into the snow.
+A skier on the foothills of a huge mountain range.
+A skier looks at mountains while standing near a trail sign.
+a single person skiing by an area with a lot of bushes
\ No newline at end of file
diff --git a/data/prompts/conversation/001_conv.txt b/data/prompts/conversation/001_conv.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8dac93823203ead2af275b908f3b3c5e4ccbe631
--- /dev/null
+++ b/data/prompts/conversation/001_conv.txt
@@ -0,0 +1,37 @@
+Question:
+What is the skier doing?
+===
+Answer:
+The skier is skiing in the snow-covered hills, making his way through the snow and enjoying the beautiful mountain scenery. They are also standing near a trail sign, which indicates their location on the mountain.
+===
+Question:
+Are there any other people or skiers visible in the image?
+===
+Answer:
+No, there is only a single person skiing in the image, and they are surrounded by an area with a lot of bushes.
+===
+Question:
+What kind of skiing is the person doing? Cross-country or downhill?
+===
+Answer:
+Based on what I can see in the photo, it is not possible to definitively determine whether the skier is doing cross-country or downhill skiing. However, given the presence of a trail sign and the fact that they are skiing in the foothills, it is more likely that the skier is engaged in cross-country skiing. Downhill skiing typically takes place on more steep slopes and involves ski lifts, whereas cross-country skiing often occurs on relatively flatter terrain with marked trails.
+===
+Question:
+Can you explain cross-country and downhill skiing a bit more?
+===
+Answer:
+Cross-country skiing and downhill skiing are two distinct types of skiing, each with its own techniques, equipment, and terrain preferences.
+
+1. Cross-Country Skiing:
+Also known as Nordic skiing, cross-country skiing involves traversing relatively flat terrain or gentle slopes using skis and poles. It is a popular recreational and competitive sport that focuses on endurance, balance, and aerobic fitness. Cross-country skiers use their own locomotion to move across snow-covered terrain, rather than relying on ski lifts or other forms of assistance.
+There are two main techniques in cross-country skiing:
+- Classic: This technique involves skiing in parallel tracks, using a forward-and-backward gliding motion while keeping the skis parallel to each other. The skier uses their poles to propel themselves forward.
+- Skate skiing: This technique is similar to ice skating, where the skier pushes off one ski at an angle and glides on the other. It requires a smooth, groomed surface and is typically faster than the classic technique.
+Cross-country ski equipment consists of lightweight skis, boots, bindings, and poles. The boots are more flexible than those used in downhill skiing, allowing for better ankle movement and control.
+
+2. Downhill Skiing:
+Also known as alpine skiing, downhill skiing involves descending slopes at high speeds using skis and poles for balance and control. This sport is more focused on speed, technique, and navigating challenging terrain, including steep slopes, moguls, and even jumps.
+Downhill skiing can be further categorized into several disciplines, such as slalom, giant slalom, super-G, and downhill racing. Each discipline has its own set of rules, courses, and ski equipment.
+Downhill ski equipment includes heavier and stiffer skis, boots, bindings, and poles than those used in cross-country skiing. The boots are more rigid to provide better support and control during high-speed descents and sharp turns.
+
+In summary, cross-country skiing is an endurance-based sport that involves traveling across flat or gently sloping terrain, while downhill skiing is focused on speed and technique as skiers navigate steeper slopes and challenging terrain. Both sports require specialized equipment and techniques, but they offer different experiences and challenges to participants.
\ No newline at end of file
diff --git a/data/prompts/conversation/system_message.txt b/data/prompts/conversation/system_message.txt
new file mode 100644
index 0000000000000000000000000000000000000000..6eb89c0c1408299f1423064814d78c293acf9da2
--- /dev/null
+++ b/data/prompts/conversation/system_message.txt
@@ -0,0 +1,12 @@
+You are an AI visual assistant, and you are seeing a single image. What you see are provided with five sentences, describing the same image you are looking at. Answer all questions as you are seeing the image.
+
+Design a conversation between you and a person asking about this photo. The answers should be in a tone that a visual AI assistant is seeing the image and answering the question.
+Ask diverse questions and give corresponding answers.
+
+Include questions asking about the visual content of the image, including the object types, counting the objects, object actions, object locations, relative positions between objects, etc. Only include questions that have definite answers:
+(1) one can see the content in the image that the question asks about and can answer confidently;
+(2) one can determine confidently from the image that it is not in the image.
+Do not ask any question that cannot be answered confidently.
+
+Also include complex questions that are relevant to the content in the image, for example, asking about background knowledge of the objects in the image, asking to discuss about events happening in the image, etc. Again, do not ask about uncertain details.
+Provide detailed answers when answering complex questions. For example, give detailed examples or reasoning steps to make the content more convincing and well-organized. You can include multiple paragraphs if necessary.
\ No newline at end of file
diff --git a/data/prompts/detail_description/000_caps.txt b/data/prompts/detail_description/000_caps.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c8c10e30e2d7f9bde33105715b04f5251d5c1950
--- /dev/null
+++ b/data/prompts/detail_description/000_caps.txt
@@ -0,0 +1,18 @@
+A harbor filled with lots of boats next to a building.
+A bicycle parked in front of several boats at a dock.
+A red bicycle in front of a line of docked white yachts
+A bike sits before boats which sit before a long building.
+A bicycle is a convenient means of land transportation when you live on a boat.
+
+bicycle: [0.287, 0.641, 0.507, 0.874]
+bicycle: [0.566, 0.667, 0.63, 0.731]
+boat: [0.318, 0.579, 0.575, 0.724]
+boat: [0.704, 0.607, 0.818, 0.727]
+boat: [0.818, 0.601, 0.942, 0.744]
+boat: [0.002, 0.53, 0.243, 0.71]
+boat: [0.541, 0.611, 0.668, 0.731]
+person: [0.778, 0.527, 0.797, 0.57]
+cup: [0.708, 0.733, 0.724, 0.758]
+boat: [0.236, 0.532, 0.404, 0.64]
+boat: [0.81, 0.632, 0.836, 0.676]
+boat: [0.957, 0.526, 1.0, 0.752]
\ No newline at end of file
diff --git a/data/prompts/detail_description/000_conv.txt b/data/prompts/detail_description/000_conv.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d4a24572427098354f723fad5e737ff6dfe223fb
--- /dev/null
+++ b/data/prompts/detail_description/000_conv.txt
@@ -0,0 +1,3 @@
+It is a harbor filled with numerous boats of various sizes docked next to a long building. Among the boats, there are a few white yachts lined up, standing out from the rest. There is a red bicycle prominently parked in front of the line of docked boats, serving as a convenient means of land transportation for those living on the boats. Another bicycle can be seen further back in the scene, near the middle of the harbor.
+
+A person is visible near the right side of the harbor, possibly enjoying the view or attending to their boat. Additionally, there is a cup placed on a surface near the middle of the scene.
\ No newline at end of file
diff --git a/data/prompts/detail_description/001_caps.txt b/data/prompts/detail_description/001_caps.txt
new file mode 100644
index 0000000000000000000000000000000000000000..2065dfb20a6e40128749d507ecc27d01349e2ad9
--- /dev/null
+++ b/data/prompts/detail_description/001_caps.txt
@@ -0,0 +1,18 @@
+A group of people standing outside of a black vehicle with various luggage.
+Luggage surrounds a vehicle in an underground parking area
+People try to fit all of their luggage in an SUV.
+The sport utility vehicle is parked in the public garage, being packed for a trip
+Some people with luggage near a van that is transporting it.
+
+person: [0.681, 0.242, 0.774, 0.694]
+person: [0.63, 0.222, 0.686, 0.516]
+person: [0.444, 0.233, 0.487, 0.34]
+backpack: [0.384, 0.696, 0.485, 0.914]
+backpack: [0.755, 0.413, 0.846, 0.692]
+suitcase: [0.758, 0.413, 0.845, 0.69]
+suitcase: [0.1, 0.497, 0.173, 0.579]
+bicycle: [0.282, 0.363, 0.327, 0.442]
+car: [0.786, 0.25, 0.848, 0.322]
+car: [0.783, 0.27, 0.827, 0.335]
+car: [0.86, 0.254, 0.891, 0.3]
+car: [0.261, 0.101, 0.787, 0.626]
\ No newline at end of file
diff --git a/data/prompts/detail_description/001_conv.txt b/data/prompts/detail_description/001_conv.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d2eaef8ea3754d8ec0695e328907a8d62553de46
--- /dev/null
+++ b/data/prompts/detail_description/001_conv.txt
@@ -0,0 +1,5 @@
+The image is an underground parking area with a black sport utility vehicle (SUV) parked. There are three people in the scene, with one person standing closer to the left side of the vehicle, another person in the middle, and the third person on the right side. They are all working together to pack their luggage into the SUV for a trip.
+
+In the parking area, various luggage items are scattered around the vehicle. There are two backpacks, one located near the left rear wheel and the other closer to the right side of the vehicle. Additionally, there are two suitcases, one on the right side of the car and another further away near the center of the parking area. A bicycle can also be seen on the left side of the vehicle.
+
+Other cars are parked around the main SUV, with one car positioned behind it and slightly to the left, another behind and slightly to the right, and the third car further behind on the right side.
\ No newline at end of file
diff --git a/data/prompts/detail_description/002_caps.txt b/data/prompts/detail_description/002_caps.txt
new file mode 100644
index 0000000000000000000000000000000000000000..70284585018497b091ba797a05d57c07e8bce3b6
--- /dev/null
+++ b/data/prompts/detail_description/002_caps.txt
@@ -0,0 +1,15 @@
+A man holds a Wii-mote above his head while another looks on.
+A guy and his friend are playing Nintendo Wii.
+A young man is holding a video game remote over his head.
+two men standing in a room while one plays with a wii mote
+Some guys standing and playing a video game.
+
+couch: [0.697, 0.759, 0.995, 1.0]
+dining table: [0.426, 0.755, 1.0, 0.987]
+person: [0.082, 0.252, 0.342, 1.0]
+person: [0.399, 0.085, 0.742, 0.982]
+remote: [0.477, 0.135, 0.516, 0.187]
+sink: [0.016, 0.501, 0.063, 0.52]
+potted plant: [0.798, 0.384, 0.888, 0.645]
+refrigerator: [0.305, 0.389, 0.414, 0.547]
+chair: [0.72, 0.509, 0.858, 0.725]
\ No newline at end of file
diff --git a/data/prompts/detail_description/002_conv.txt b/data/prompts/detail_description/002_conv.txt
new file mode 100644
index 0000000000000000000000000000000000000000..56881c770ec5aca56bc2bf6c38cb6101ae58fa24
--- /dev/null
+++ b/data/prompts/detail_description/002_conv.txt
@@ -0,0 +1,3 @@
+The image shows two men standing in a room, engaged in playing a video game on a Nintendo Wii console. One of the men is holding a Wii remote above his head with enthusiasm, while the other man looks on, likely enjoying the friendly competition.
+
+The room appears to be a living space with a couch located in the background and a dining table nearby. A potted plant can be seen placed close to the couch, and a chair is situated in the middle of the room. The room also features a kitchen area with a sink and a refrigerator visible in the background.
\ No newline at end of file
diff --git a/data/prompts/detail_description/system_message.txt b/data/prompts/detail_description/system_message.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fa836ca4b4d836a539f7e6d0aa2a012e6996edf5
--- /dev/null
+++ b/data/prompts/detail_description/system_message.txt
@@ -0,0 +1,7 @@
+You are an AI visual assistant that can analyze a single image. You receive five sentences, each describing the same image you are observing. In addition, specific object locations within the image are given, along with detailed coordinates. These coordinates are in the form of bounding boxes, represented as (x1, y1, x2, y2) with floating numbers ranging from 0 to 1. These values correspond to the top left x, top left y, bottom right x, and bottom right y.
+
+Using the provided caption and bounding box information, describe the scene in a detailed manner.
+
+Instead of directly mentioning the bounding box coordinates, utilize this data to explain the scene using natural language. Include details like object counts, position of the objects, relative position between the objects.
+
+When using the information from the caption and coordinates, directly explain the scene, and do not mention that the information source is the caption or the bounding box. Always answer as if you are directly looking at the image.
\ No newline at end of file
diff --git a/docs/Customize_Component.md b/docs/Customize_Component.md
new file mode 100644
index 0000000000000000000000000000000000000000..e99a60879920b389799fb3a0baf1fd864ee0bccc
--- /dev/null
+++ b/docs/Customize_Component.md
@@ -0,0 +1,20 @@
+# Customize Components in LLaVA
+
+This is an initial guide on how to replace the LLMs, visual encoders, etc. with your choice of components.
+
+## LLM
+
+It is quite simple to swap out LLaMA to any other LLMs. You can refer to our implementation of [`llava_llama.py`](https://raw.githubusercontent.com/haotian-liu/LLaVA/main/llava/model/language_model/llava_llama.py) for an example of how to replace the LLM.
+
+Although it may seem that it still needs ~100 lines of code, most of them are copied from the original `llama.py` from HF. The only part that is different is to insert some lines for processing the multimodal inputs.
+
+In `forward` function, you can see that we call `self.prepare_inputs_labels_for_multimodal` to process the multimodal inputs. This function is defined in `LlavaMetaForCausalLM` and you just need to insert it into the `forward` function of your LLM.
+
+In `prepare_inputs_for_generation` function, you can see that we add `images` to the `model_inputs`. This is because we need to pass the images to the LLM during generation.
+
+These are basically all the changes you need to make to replace the LLM.
+
+## Visual Encoder
+
+You can check out [`clip_encoder.py`](https://github.com/haotian-liu/LLaVA/blob/main/llava/model/multimodal_encoder/clip_encoder.py) on how we implement the CLIP visual encoder.
+
diff --git a/docs/Data.md b/docs/Data.md
new file mode 100644
index 0000000000000000000000000000000000000000..84807ec252858cd78bf96b3fce6f42f66b20126f
--- /dev/null
+++ b/docs/Data.md
@@ -0,0 +1,29 @@
+## Data
+
+| Data file name | Size |
+| --- | ---: |
+| [llava_instruct_150k.json](https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K/blob/main/llava_instruct_150k.json) | 229 MB |
+| [llava_instruct_80k.json](https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K/blob/main/llava_instruct_80k.json) | 229 MB |
+| [conversation_58k.json](https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K/blob/main/conversation_58k.json) | 126 MB |
+| [detail_23k.json](https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K/blob/main/detail_23k.json) | 20.5 MB |
+| [complex_reasoning_77k.json](https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K/blob/main/complex_reasoning_77k.json) | 79.6 MB |
+
+### Pretraining Dataset
+The pretraining dataset used in this release is a subset of CC-3M dataset, filtered with a more balanced concept coverage distribution. Please see [here](https://huggingface.co/datasets/liuhaotian/LLaVA-CC3M-Pretrain-595K) for a detailed description of the dataset structure and how to download the images.
+
+If you already have CC-3M dataset on your disk, the image names follow this format: `GCC_train_000000000.jpg`. You may edit the `image` field correspondingly if necessary.
+
+| Data | Chat File | Meta Data | Size |
+| --- | --- | --- | ---: |
+| CC-3M Concept-balanced 595K | [chat.json](https://huggingface.co/datasets/liuhaotian/LLaVA-CC3M-Pretrain-595K/blob/main/chat.json) | [metadata.json](https://huggingface.co/datasets/liuhaotian/LLaVA-CC3M-Pretrain-595K/blob/main/metadata.json) | 211 MB
+| LAION/CC/SBU BLIP-Caption Concept-balanced 558K | [blip_laion_cc_sbu_558k.json](https://huggingface.co/datasets/liuhaotian/LLaVA-Pretrain/blob/main/blip_laion_cc_sbu_558k.json) | [metadata.json](#) | 181 MB
+
+**Important notice**: Upon the request from the community, as ~15% images of the original CC-3M dataset are no longer accessible, we upload [`images.zip`](https://huggingface.co/datasets/liuhaotian/LLaVA-CC3M-Pretrain-595K/blob/main/images.zip) for better reproducing our work in research community. It must not be used for any other purposes. The use of these images must comply with the CC-3M license. This may be taken down at any time when requested by the original CC-3M dataset owner or owners of the referenced images.
+
+### GPT-4 Prompts
+
+We provide our prompts and few-shot samples for GPT-4 queries, to better facilitate research in this domain. Please check out the [`prompts`](playground/data/prompts) folder for three kinds of questions: conversation, detail description, and complex reasoning.
+
+They are organized in a format of `system_message.txt` for system message, pairs of `abc_caps.txt` for few-shot sample user input, and `abc_conv.txt` for few-shot sample reference output.
+
+Note that you may find them in different format. For example, `conversation` is in `jsonl`, and detail description is answer-only. The selected format in our preliminary experiments works slightly better than a limited set of alternatives that we tried: `jsonl`, more natural format, answer-only. If interested, you may try other variants or conduct more careful study in this. Contributions are welcomed!
diff --git a/docs/LLaVA_Bench.md b/docs/LLaVA_Bench.md
new file mode 100644
index 0000000000000000000000000000000000000000..5921964c43f599b2d820de5092a1c3b4c39de60f
--- /dev/null
+++ b/docs/LLaVA_Bench.md
@@ -0,0 +1,31 @@
+# LLaVA-Bench [[Download](https://huggingface.co/datasets/liuhaotian/llava-bench-in-the-wild)]
+
+**-Introduction-** Large commercial multimodal chatbots have been released in this week, including
+- [Multimodal Bing-Chat by Microsoft](https://blogs.bing.com/search/july-2023/Bing-Chat-Enterprise-announced,-multimodal-Visual-Search-rolling-out-to-Bing-Chat) (July 18, 2023)
+- [Multimodal Bard by Google](https://bard.google.com/).
+
+These chatbots are presumably supported by proprietary large multimodal models (LMM). Compared with the open-source LMM such as LLaVA, proprietary LMM represent the scaling success upperbound of the current SoTA techniques. They share the goal of developing multimodal chatbots that follow human intents to complete various daily-life visual tasks in the wild. While it remains less unexplored how to evaluate multimodal chat ability, it provides useful feedback to study open-source LMMs against the commercial multimodal chatbots. In addition to the *LLaVA-Bench (COCO)* dataset we used to develop the early versions of LLaVA, we are releasing [*LLaVA-Bench (In-the-Wild)*](https://huggingface.co/datasets/liuhaotian/llava-bench-in-the-wild) to the community for the public use.
+
+## LLaVA-Bench (In-the-Wild *[Ongoing work]*)
+
+To evaluate the model's capability in more challenging tasks and generalizability to novel domains, we collect a diverse set of 24 images with 60 questions in total, including indoor and outdoor scenes, memes, paintings, sketches, etc, and associate each image with a highly-detailed and manually-curated description and a proper selection of questions. Such design also assesses the model's robustness to different prompts. In this release, we also categorize questions into three categories: conversation (simple QA), detailed description, and complex reasoning. We continue to expand and improve the diversity of the LLaVA-Bench (In-the-Wild). We manually query Bing-Chat and Bard to get the responses.
+
+### Results
+
+The score is measured by comparing against a reference answer generated by text-only GPT-4. It is generated by feeding the question, along with the ground truth image annotations as the context. A text-only GPT-4 evaluator rates both answers. We query GPT-4 by putting the reference answer first, and then the answer generated by the candidate model. We upload images at their original resolution to Bard and Bing-Chat to obtain the results.
+
+| Approach | Conversation | Detail | Reasoning | Overall |
+|----------------|--------------|--------|-----------|---------|
+| Bard-0718 | 83.7 | 69.7 | 78.7 | 77.8 |
+| Bing-Chat-0629 | 59.6 | 52.2 | 90.1 | 71.5 |
+| LLaVA-13B-v1-336px-0719 (beam=1) | 64.3 | 55.9 | 81.7 | 70.1 |
+| LLaVA-13B-v1-336px-0719 (beam=5) | 68.4 | 59.9 | 84.3 | 73.5 |
+
+Note that Bard sometimes refuses to answer questions about images containing humans, and Bing-Chat blurs the human faces in the images. We also provide the benchmark score for the subset without humans.
+
+| Approach | Conversation | Detail | Reasoning | Overall |
+|----------------|--------------|--------|-----------|---------|
+| Bard-0718 | 94.9 | 74.3 | 84.3 | 84.6 |
+| Bing-Chat-0629 | 55.8 | 53.6 | 93.5 | 72.6 |
+| LLaVA-13B-v1-336px-0719 (beam=1) | 62.2 | 56.4 | 82.2 | 70.0 |
+| LLaVA-13B-v1-336px-0719 (beam=5) | 65.6 | 61.7 | 85.0 | 73.6 |
diff --git a/docs/LLaVA_from_LLaMA2.md b/docs/LLaVA_from_LLaMA2.md
new file mode 100644
index 0000000000000000000000000000000000000000..b4163668a33ff705c28f5b103b727514161e5652
--- /dev/null
+++ b/docs/LLaVA_from_LLaMA2.md
@@ -0,0 +1,29 @@
+# LLaVA (based on Llama 2 LLM, Preview)
+
+*NOTE: This is a technical preview. We are still running hyperparameter search, and will release the final model soon. If you'd like to contribute to this, please contact us.*
+
+:llama: **-Introduction-** [Llama 2 is an open-source LLM released by Meta AI](https://about.fb.com/news/2023/07/llama-2/) today (July 18, 2023). Compared with its early version [Llama 1](https://ai.meta.com/blog/large-language-model-llama-meta-ai/), Llama 2 is more favored in ***stronger language performance***, ***longer context window***, and importantly ***commercially usable***! While Llama 2 is changing the LLM market landscape in the language space, its multimodal ability remains unknown. We quickly develop the LLaVA variant based on the latest Llama 2 checkpoints, and release it to the community for the public use.
+
+You need to apply for and download the lastest Llama 2 checkpoints to start your own training (apply [here](https://ai.meta.com/resources/models-and-libraries/llama-downloads/))
+
+
+## Training
+
+Please checkout [`pretrain.sh`](https://github.com/haotian-liu/LLaVA/blob/main/scripts/pretrain.sh), [`finetune.sh`](https://github.com/haotian-liu/LLaVA/blob/main/scripts/finetune.sh), [`finetune_lora.sh`](https://github.com/haotian-liu/LLaVA/blob/main/scripts/finetune_lora.sh).
+
+## LLaVA (based on Llama 2), What is different?
+
+:volcano: How is the new LLaVA based on Llama 2 different from Llama 1? The comparisons of the training process are described:
+- **Pre-training**. The pre-trained base LLM is changed from Llama 1 to Llama 2
+- **Language instruction-tuning**. The previous LLaVA model starts with Vicuna, which is instruct tuned on ShareGPT data from Llama 1; The new LLaVA model starts with Llama 2 Chat, which is an instruct tuned checkpoint on dialogue data from Llama 2.
+- **Multimodal instruction-tuning**. The same LLaVA-Lighting process is applied.
+
+
+### Results
+
+- Llama 2 is better at following the instructions of role playing; Llama 2 fails in following the instructions of translation
+- The quantitative evaluation on [LLaVA-Bench](https://github.com/haotian-liu/LLaVA/blob/main/docs/LLaVA_Bench.md) demonstrates on-par performance between Llama 2 and Llama 1 in LLaVA's multimodal chat ability.
+
+
+
+
diff --git a/docs/LoRA.md b/docs/LoRA.md
new file mode 100644
index 0000000000000000000000000000000000000000..369fe92579051f98a0724a92e52e65e014a0de2f
--- /dev/null
+++ b/docs/LoRA.md
@@ -0,0 +1,46 @@
+# LLaVA (LoRA, Preview)
+
+NOTE: This is a technical preview, and is not yet ready for production use. We are still running hyperparameter search for the LoRA model, and will release the final model soon. If you'd like to contribute to this, please contact us.
+
+You need latest code base for LoRA support (instructions [here](https://github.com/haotian-liu/LLaVA#upgrade-to-latest-code-base))
+
+## Demo (Web UI)
+
+Please execute each of the command below one by one (after the previous one has finished). The commands are the same as launching other demos except for an additional `--model-base` flag to specify the base model to use. Please make sure the base model corresponds to the LoRA checkpoint that you are using. For this technical preview, you need Vicuna v1.1 (7B) checkpoint (if you do not have that already, follow the instructions [here](https://github.com/lm-sys/FastChat#vicuna-weights)).
+
+#### Launch a controller
+```Shell
+python -m llava.serve.controller --host 0.0.0.0 --port 10000
+```
+
+#### Launch a gradio web server.
+```Shell
+python -m llava.serve.gradio_web_server --controller http://localhost:10000 --model-list-mode reload
+```
+You just launched the Gradio web interface. Now, you can open the web interface with the URL printed on the screen. You may notice that there is no model in the model list. Do not worry, as we have not launched any model worker yet. It will be automatically updated when you launch a model worker.
+
+#### Launch a model worker
+```Shell
+python -m llava.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40000 --worker http://localhost:40000 --model-path liuhaotian/llava-vicuna-7b-v1.1-lcs_558k-instruct_80k_3e-lora-preview-alpha --model-base /path/to/vicuna-v1.1
+```
+Wait until the process finishes loading the model and you see "Uvicorn running on ...". Now, refresh your Gradio web UI, and you will see the model you just launched in the model list.
+
+You can launch as many workers as you want, and compare between different model checkpoints in the same Gradio interface. Please keep the `--controller` the same, and modify the `--port` and `--worker` to a different port number for each worker.
+
+
+## Training
+
+Please see sample training scripts for [LoRA](https://github.com/haotian-liu/LLaVA/blob/main/scripts/finetune_lora.sh) and [QLoRA](https://github.com/haotian-liu/LLaVA/blob/main/scripts/finetune_qlora.sh).
+
+We provide sample DeepSpeed configs, [`zero3.json`](https://github.com/haotian-liu/LLaVA/blob/main/scripts/zero3.json) is more like PyTorch FSDP, and [`zero3_offload.json`](https://github.com/haotian-liu/LLaVA/blob/main/scripts/zero3_offload.json) can further save memory consumption by offloading parameters to CPU. `zero3.json` is usually faster than `zero3_offload.json` but requires more GPU memory, therefore, we recommend trying `zero3.json` first, and if you run out of GPU memory, try `zero3_offload.json`. You can also tweak the `per_device_train_batch_size` and `gradient_accumulation_steps` in the config to save memory, and just to make sure that `per_device_train_batch_size` and `gradient_accumulation_steps` remains the same.
+
+If you are having issues with ZeRO-3 configs, and there are enough VRAM, you may try [`zero2.json`](https://github.com/haotian-liu/LLaVA/blob/main/scripts/zero2.json). This consumes slightly more memory than ZeRO-3, and behaves more similar to PyTorch FSDP, while still supporting parameter-efficient tuning.
+
+## Create Merged Checkpoints
+
+```Shell
+python scripts/merge_lora_weights.py \
+ --model-path /path/to/lora_model \
+ --model-base /path/to/base_model \
+ --save-model-path /path/to/merge_model
+```
diff --git a/docs/MODEL_ZOO.md b/docs/MODEL_ZOO.md
new file mode 100644
index 0000000000000000000000000000000000000000..d7d50a17cadf751f17f40cb0630ad3becd97fbbf
--- /dev/null
+++ b/docs/MODEL_ZOO.md
@@ -0,0 +1,136 @@
+# Model Zoo
+
+**To Use LLaVA-1.5 checkpoints, your llava package version must be newer than 1.1.0. [Instructions](https://github.com/haotian-liu/LLaVA#upgrade-to-latest-code-base) on how to upgrade.**
+
+If you are interested in including any other details in Model Zoo, please open an issue :)
+
+The model weights below are *merged* weights. You do not need to apply delta. The usage of LLaVA checkpoints should comply with the base LLM's model license: [LLaMA](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md).
+
+## LLaVA-v1.5
+
+| Version | Size | Schedule | Checkpoint | VQAv2 | GQA | VizWiz | SQA | T-VQA | POPE | MME | MM-Bench | MM-Bench-CN | SEED | LLaVA-Bench-Wild | MM-Vet |
+|----------|----------|-----------|-----------|---|---|---|---|---|---|---|---|---|---|---|---|
+| LLaVA-1.5 | 7B | full_ft-1e | [liuhaotian/llava-v1.5-7b](https://huggingface.co/liuhaotian/llava-v1.5-7b) | 78.5 | 62.0 | 50.0 | 66.8 | 58.2 | 85.9 | 1510.7 | 64.3 | 58.3 | 58.6 | 63.4 | 30.5 |
+| LLaVA-1.5 | 13B | full_ft-1e | [liuhaotian/llava-v1.5-13b](https://huggingface.co/liuhaotian/llava-v1.5-13b) | 80.0 | 63.3 | 53.6 | 71.6 | 61.3 | 85.9 | 1531.3 | 67.7 | 63.6 | 61.6 | 70.7 | 35.4 |
+| LLaVA-1.5 | 7B | lora-1e | coming soon |
+| LLaVA-1.5 | 13B | lora-1e | coming soon |
+
+
+
+ LLaVA-1.5 achieves SoTA performance across 11 benchmarks.
+
+
+
+## LLaVA-v1
+
+*Note: We recommend using the most capable LLaVA-v1.5 series above for the best performance.*
+
+| Base LLM | Vision Encoder | Pretrain Data | Pretraining schedule | Finetuning Data | Finetuning schedule | LLaVA-Bench-Conv | LLaVA-Bench-Detail | LLaVA-Bench-Complex | LLaVA-Bench-Overall | Download |
+|----------|----------------|---------------|----------------------|-----------------|--------------------|------------------|--------------------|---------------------|---------------------|---------------------|
+| Vicuna-13B-v1.3 | CLIP-L-336px | LCS-558K | 1e | LLaVA-Instruct-80K | proj-1e, lora-1e | 64.3 | 55.9 | 81.7 | 70.1 | [LoRA](https://huggingface.co/liuhaotian/llava-v1-0719-336px-lora-vicuna-13b-v1.3) [LoRA-Merged](https://huggingface.co/liuhaotian/llava-v1-0719-336px-lora-merge-vicuna-13b-v1.3) |
+| LLaMA-2-13B-Chat | CLIP-L | LCS-558K | 1e | LLaVA-Instruct-80K | full_ft-1e | 56.7 | 58.6 | 80.0 | 67.9 | [ckpt](https://huggingface.co/liuhaotian/llava-llama-2-13b-chat-lightning-preview) |
+| LLaMA-2-7B-Chat | CLIP-L | LCS-558K | 1e | LLaVA-Instruct-80K | lora-1e | 51.2 | 58.9 | 71.6 | 62.8 | [LoRA](https://huggingface.co/liuhaotian/llava-llama-2-7b-chat-lightning-lora-preview) |
+
+
+## Projector weights
+
+The model weights below are projector weights we have pretrained. You can use these projector weights for visual instruction tuning. We'll add more projector weights into model zoo very soon.
+
+**NOTE**: These projector weights are only compatible with the `llava>=1.0.0`, please check out the latest code base if your local code version is below `v1.0.0`.
+
+**NOTE**: When you use our pretrained projector for visual instruction tuning, it is very important to **use the same base LLM and vision encoder** as the one we used for pretraining the projector. Otherwise, the performance will be very bad.
+
+When using these projector weights to instruction tune your LMM, please make sure that these options are correctly set as follows,
+
+```Shell
+--mm_use_im_start_end False
+--mm_use_im_patch_token False
+```
+
+| Base LLM | Vision Encoder | Projection | Pretrain Data | Pretraining schedule | Download |
+|----------|----------------|---------------|----------------------|----------|----------|
+| Vicuna-13B-v1.5 | CLIP-L-336px | MLP-2x | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/llava-v1.5-mlp2x-336px-pretrain-vicuna-13b-v1.5) |
+| Vicuna-7B-v1.5 | CLIP-L-336px | MLP-2x | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/llava-v1.5-mlp2x-336px-pretrain-vicuna-7b-v1.5) |
+| LLaMA-2-13B-Chat | CLIP-L-336px | Linear | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/llava-336px-pretrain-llama-2-13b-chat) |
+| LLaMA-2-7B-Chat | CLIP-L-336px | Linear | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/llava-336px-pretrain-llama-2-7b-chat) |
+| LLaMA-2-13B-Chat | CLIP-L | Linear | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/llava-pretrain-llama-2-13b-chat) |
+| LLaMA-2-7B-Chat | CLIP-L | Linear | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/llava-pretrain-llama-2-7b-chat) |
+| Vicuna-13B-v1.3 | CLIP-L-336px | Linear | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/llava-336px-pretrain-vicuna-13b-v1.3) |
+| Vicuna-7B-v1.3 | CLIP-L-336px | Linear | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/llava-336px-pretrain-vicuna-7b-v1.3) |
+| Vicuna-13B-v1.3 | CLIP-L | Linear | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/llava-pretrain-vicuna-13b-v1.3) |
+| Vicuna-7B-v1.3 | CLIP-L | Linear | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/llava-pretrain-vicuna-7b-v1.3) |
+
+
+## Science QA Checkpoints
+
+| Base LLM | Vision Encoder | Pretrain Data | Pretraining schedule | Finetuning Data | Finetuning schedule | Download |
+|----------|----------------|---------------|----------------------|-----------------|--------------------|---------------------|
+| Vicuna-13B-v1.3 | CLIP-L | LCS-558K | 1e | ScienceQA | full_ft-12e | [ckpt](https://huggingface.co/liuhaotian/llava-lcs558k-scienceqa-vicuna-13b-v1.3) |
+
+
+## Legacy Models (merged weights)
+
+The model weights below are *merged* weights. You do not need to apply delta. The usage of LLaVA checkpoints should comply with the base LLM's model license.
+
+| Base LLM | Vision Encoder | Pretrain Data | Pretraining schedule | Finetuning Data | Finetuning schedule | Download |
+|----------|----------------|---------------|----------------------|-----------------|--------------------|------------------|
+| MPT-7B-Chat | CLIP-L | LCS-558K | 1e | LLaVA-Instruct-80K | full_ft-1e | [preview](https://huggingface.co/liuhaotian/LLaVA-Lightning-MPT-7B-preview) |
+
+
+## Legacy Models (delta weights)
+
+The model weights below are *delta* weights. The usage of LLaVA checkpoints should comply with the base LLM's model license: [LLaMA](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md).
+
+You can add our delta to the original LLaMA weights to obtain the LLaVA weights.
+
+Instructions:
+
+1. Get the original LLaMA weights in the huggingface format by following the instructions [here](https://huggingface.co/docs/transformers/main/model_doc/llama).
+2. Use the following scripts to get LLaVA weights by applying our delta. It will automatically download delta weights from our Hugging Face account. In the script below, we use the delta weights of [`liuhaotian/LLaVA-7b-delta-v0`](https://huggingface.co/liuhaotian/LLaVA-7b-delta-v0) as an example. It can be adapted for other delta weights by changing the `--delta` argument (and base/target accordingly).
+
+```bash
+python3 -m llava.model.apply_delta \
+ --base /path/to/llama-7b \
+ --target /output/path/to/LLaVA-7B-v0 \
+ --delta liuhaotian/LLaVA-7b-delta-v0
+```
+
+| Base LLM | Vision Encoder | Pretrain Data | Pretraining schedule | Finetuning Data | Finetuning schedule | Download |
+|----------|----------------|---------------|----------------------|-----------------|--------------------|------------------|
+| Vicuna-13B-v1.1 | CLIP-L | CC-595K | 1e | LLaVA-Instruct-158K | full_ft-3e | [delta-weights](https://huggingface.co/liuhaotian/LLaVA-13b-delta-v1-1) |
+| Vicuna-7B-v1.1 | CLIP-L | LCS-558K | 1e | LLaVA-Instruct-80K | full_ft-1e | [delta-weights](https://huggingface.co/liuhaotian/LLaVA-Lightning-7B-delta-v1-1) |
+| Vicuna-13B-v0 | CLIP-L | CC-595K | 1e | LLaVA-Instruct-158K | full_ft-3e | [delta-weights](https://huggingface.co/liuhaotian/LLaVA-13b-delta-v0) |
+| Vicuna-13B-v0 | CLIP-L | CC-595K | 1e | ScienceQA | full_ft-12e | [delta-weights](https://huggingface.co/liuhaotian/LLaVA-13b-delta-v0-science_qa) |
+| Vicuna-7B-v0 | CLIP-L | CC-595K | 1e | LLaVA-Instruct-158K | full_ft-3e | [delta-weights](https://huggingface.co/liuhaotian/LLaVA-7b-delta-v0) |
+
+
+
+## Legacy Projector weights
+
+The following projector weights are deprecated, and the support for them may be removed in the future. They do not support zero-shot inference. Please use the projector weights in the [table above](#projector-weights) if possible.
+
+**NOTE**: When you use our pretrained projector for visual instruction tuning, it is very important to **use the same base LLM and vision encoder** as the one we used for pretraining the projector. Otherwise, the performance will be very bad.
+
+When using these projector weights to instruction tune your LMM, please make sure that these options are correctly set as follows,
+
+```Shell
+--mm_use_im_start_end True
+--mm_use_im_patch_token False
+```
+
+| Base LLM | Vision Encoder | Pretrain Data | Pretraining schedule | Download |
+|----------|----------------|---------------|----------------------|----------|
+| Vicuna-7B-v1.1 | CLIP-L | LCS-558K | 1e | [projector](https://huggingface.co/liuhaotian/LLaVA-Pretrained-Projectors/blob/main/LLaVA-7b-pretrain-projector-v1-1-LCS-558K-blip_caption.bin) |
+| Vicuna-13B-v0 | CLIP-L | CC-595K | 1e | [projector](https://huggingface.co/liuhaotian/LLaVA-Pretrained-Projectors/blob/main/LLaVA-13b-pretrain-projector-v0-CC3M-595K-original_caption.bin) |
+| Vicuna-7B-v0 | CLIP-L | CC-595K | 1e | [projector](https://huggingface.co/liuhaotian/LLaVA-Pretrained-Projectors/blob/main/LLaVA-7b-pretrain-projector-v0-CC3M-595K-original_caption.bin) |
+
+When using these projector weights to instruction tune your LMM, please make sure that these options are correctly set as follows,
+
+```Shell
+--mm_use_im_start_end False
+--mm_use_im_patch_token False
+```
+
+| Base LLM | Vision Encoder | Pretrain Data | Pretraining schedule | Download |
+|----------|----------------|---------------|----------------------|----------|
+| Vicuna-13B-v0 | CLIP-L | CC-595K | 1e | [projector](https://huggingface.co/liuhaotian/LLaVA-Pretrained-Projectors/blob/main/LLaVA-13b-pretrain-projector-v0-CC3M-595K-original_caption-no_im_token.bin) |
diff --git a/docs/ScienceQA.md b/docs/ScienceQA.md
new file mode 100644
index 0000000000000000000000000000000000000000..8881c41c67002a3798435b051c9a609dd1c0d506
--- /dev/null
+++ b/docs/ScienceQA.md
@@ -0,0 +1,53 @@
+### ScienceQA
+
+#### Prepare Data
+1. Please see ScienceQA [repo](https://github.com/lupantech/ScienceQA) for setting up the dataset.
+2. Generate ScienceQA dataset for LLaVA conversation-style format.
+
+```Shell
+python scripts/convert_sqa_to_llava.py \
+ convert_to_llava \
+ --base-dir /path/to/ScienceQA/data/scienceqa \
+ --prompt-format "QCM-LEA" \
+ --split {train,val,minival,test,minitest}
+```
+
+#### Training
+
+1. Pretraining
+
+You can download our pretrained projector weights from our [Model Zoo](), or train your own projector weights using [`pretrain.sh`](https://github.com/haotian-liu/LLaVA/blob/main/scripts/pretrain.sh).
+
+2. Finetuning
+
+See [`finetune_sqa.sh`](https://github.com/haotian-liu/LLaVA/blob/main/scripts/finetune_sqa.sh).
+
+#### Evaluation
+
+1. Multiple-GPU inference
+You may evaluate this with multiple GPUs, and concatenate the generated jsonl files. Please refer to our script for [batch evaluation](https://github.com/haotian-liu/LLaVA/blob/main/scripts/sqa_eval_batch.sh) and [results gathering](https://github.com/haotian-liu/LLaVA/blob/main/scripts/sqa_eval_gather.sh).
+
+2. Single-GPU inference
+
+(a) Generate LLaVA responses on ScienceQA dataset
+
+```Shell
+python -m llava.eval.model_vqa_science \
+ --model-path liuhaotian/llava-lcs558k-scienceqa-vicuna-13b-v1.3 \
+ --question-file /path/to/ScienceQA/data/scienceqa/llava_test_QCM-LEA.json \
+ --image-folder /path/to/ScienceQA/data/scienceqa/images/test \
+ --answers-file vqa/results/ScienceQA/test_llava-13b.jsonl \
+ --conv-mode llava_v1
+```
+
+(b) Evaluate the generated responses
+
+```Shell
+python eval_science_qa.py \
+ --base-dir /path/to/ScienceQA/data/scienceqa \
+ --result-file vqa/results/ScienceQA/test_llava-13b.jsonl \
+ --output-file vqa/results/ScienceQA/test_llava-13b_output.json \
+ --output-result vqa/results/ScienceQA/test_llava-13b_result.json \
+```
+
+For reference, we attach our prediction file [`test_sqa_llava_lcs_558k_sqa_12e_vicuna_v1_3_13b.json`](https://github.com/haotian-liu/LLaVA/blob/main/llava/eval/table/results/test_sqa_llava_lcs_558k_sqa_12e_vicuna_v1_3_13b.json) and [`test_sqa_llava_13b_v0.json`](https://github.com/haotian-liu/LLaVA/blob/main/llava/eval/table/results/test_sqa_llava_13b_v0.json) for comparison when reproducing our results, as well as for further analysis in detail.
diff --git a/gradio_web_server.log b/gradio_web_server.log
new file mode 100644
index 0000000000000000000000000000000000000000..48447321292b7b52f61d01f1159e6b7b99bab966
--- /dev/null
+++ b/gradio_web_server.log
@@ -0,0 +1,2010 @@
+2024-10-09 14:33:31 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:33:31 | INFO | stdout | Starting the controller
+2024-10-09 14:33:31 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:33:31 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:33:31 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-4bit']
+2024-10-09 14:33:41 | ERROR | stderr | /Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/gradio/components/dropdown.py:163: UserWarning: The value passed into gr.Dropdown() is not in the list of choices. Please update the list of choices to include: or set allow_custom_value=True.
+2024-10-09 14:33:41 | ERROR | stderr | warnings.warn(
+2024-10-09 14:33:41 | INFO | stdout | Running on local URL: http://0.0.0.0:7860
+2024-10-09 14:33:41 | INFO | httpx | HTTP Request: GET http://localhost:7860/startup-events "HTTP/1.1 200 OK"
+2024-10-09 14:33:41 | INFO | httpx | HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
+2024-10-09 14:33:41 | INFO | stdout |
+2024-10-09 14:33:41 | INFO | stdout | To create a public link, set `share=True` in `launch()`.
+2024-10-09 14:33:41 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:33:41 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:33:41 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:33:41 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:33:41 | INFO | stdout | --------
+2024-10-09 14:33:41 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
+2024-10-09 14:33:41 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-launched-telemetry/ "HTTP/1.1 200 OK"
+2024-10-09 14:33:48 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:33:48 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:33:48 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:33:48 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:33:48 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:33:48 | ERROR | stderr |
+2024-10-09 14:33:48 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:33:48 | ERROR | stderr |
+2024-10-09 14:33:48 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:33:48 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:33:48 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:33:48 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:33:48 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:33:48 | ERROR | stderr | raise exc
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:33:48 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:33:48 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:33:48 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:33:48 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:33:48 | ERROR | stderr | raise exc
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:33:48 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:33:48 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:33:48 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:33:48 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:33:48 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:33:48 | ERROR | stderr | raise exc
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:33:48 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:33:48 | ERROR | stderr | response = await f(request)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:33:48 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:33:48 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:33:48 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:33:48 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:33:48 | ERROR | stderr | return [
+2024-10-09 14:33:48 | ERROR | stderr | ^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:33:48 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:33:48 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:33:48 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:33:48 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:33:48 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:33:48 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:33:48 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:33:48 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:33:48 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:33:48 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:33:48 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:33:48 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:33:48 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:33:48 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:33:48 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:33:48 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:33:48 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:33:48 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:33:48 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:33:48 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:33:48 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:33:48 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:33:48 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:33:48 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:33:48 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:33:48 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:33:48 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:33:48 | ERROR | stderr |
+2024-10-09 14:33:48 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:33:48 | ERROR | stderr |
+2024-10-09 14:33:48 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:34:00 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:34:00 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:34:00 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:34:00 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:34:00 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:34:00 | ERROR | stderr |
+2024-10-09 14:34:00 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:34:00 | ERROR | stderr |
+2024-10-09 14:34:00 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:34:00 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:34:00 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:34:00 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:34:00 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:34:00 | ERROR | stderr | raise exc
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:34:00 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:34:00 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:34:00 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:34:00 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:00 | ERROR | stderr | raise exc
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:00 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:34:00 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:34:00 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:34:00 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:34:00 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:00 | ERROR | stderr | raise exc
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:00 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:34:00 | ERROR | stderr | response = await f(request)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:34:00 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:34:00 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:34:00 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:34:00 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:34:00 | ERROR | stderr | return [
+2024-10-09 14:34:00 | ERROR | stderr | ^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:34:00 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:34:00 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:34:00 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:34:00 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:34:00 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:34:00 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:34:00 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:00 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:34:00 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:34:00 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:34:00 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:00 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:34:00 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:34:00 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:00 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:34:00 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:00 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:34:00 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:34:00 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:34:00 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:00 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:00 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:34:00 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:34:00 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:00 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:34:00 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:34:00 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:34:00 | ERROR | stderr |
+2024-10-09 14:34:00 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:34:00 | ERROR | stderr |
+2024-10-09 14:34:00 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:34:18 | INFO | stdout | Changes detected in: /Users/geminigby/PycharmProjects/llava_demo/UGround/app.py
+2024-10-09 14:34:18 | ERROR | stderr | Exception in thread Thread-5:
+2024-10-09 14:34:18 | ERROR | stderr | Exception in thread Thread-5:
+2024-10-09 14:34:18 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:18 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:18 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
+2024-10-09 14:34:18 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
+2024-10-09 14:34:18 | ERROR | stderr | self.run()
+2024-10-09 14:34:18 | ERROR | stderr | self.run()
+2024-10-09 14:34:18 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 982, in run
+2024-10-09 14:34:18 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 982, in run
+2024-10-09 14:34:18 | ERROR | stderr | self._target(*self._args, **self._kwargs)
+2024-10-09 14:34:18 | ERROR | stderr | self._target(*self._args, **self._kwargs)
+2024-10-09 14:34:18 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/gradio/utils.py", line 218, in watchfn
+2024-10-09 14:34:18 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/gradio/utils.py", line 218, in watchfn
+2024-10-09 14:34:18 | ERROR | stderr | demo = getattr(module, reloader.demo_name)
+2024-10-09 14:34:18 | ERROR | stderr | demo = getattr(module, reloader.demo_name)
+2024-10-09 14:34:18 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:18 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:18 | ERROR | stderr | AttributeError: module 'app' has no attribute 'demo'
+2024-10-09 14:34:18 | ERROR | stderr | AttributeError: module 'app' has no attribute 'demo'
+2024-10-09 14:34:27 | INFO | stdout | Keyboard interruption in main thread... closing server.
+2024-10-09 14:34:27 | INFO | stdout | Keyboard interruption in main thread... closing server.
+2024-10-09 14:34:35 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:34:35 | INFO | stdout | Starting the controller
+2024-10-09 14:34:35 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:34:35 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:34:35 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-8bit']
+2024-10-09 14:34:45 | ERROR | stderr | /Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/gradio/components/dropdown.py:163: UserWarning: The value passed into gr.Dropdown() is not in the list of choices. Please update the list of choices to include: or set allow_custom_value=True.
+2024-10-09 14:34:45 | ERROR | stderr | warnings.warn(
+2024-10-09 14:34:45 | INFO | stdout | Running on local URL: http://0.0.0.0:7860
+2024-10-09 14:34:46 | INFO | httpx | HTTP Request: GET http://localhost:7860/startup-events "HTTP/1.1 200 OK"
+2024-10-09 14:34:46 | INFO | httpx | HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
+2024-10-09 14:34:46 | INFO | stdout |
+2024-10-09 14:34:46 | INFO | stdout | To create a public link, set `share=True` in `launch()`.
+2024-10-09 14:34:46 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:34:46 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:34:46 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:34:46 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:34:46 | INFO | stdout | --------
+2024-10-09 14:34:46 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
+2024-10-09 14:34:46 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-launched-telemetry/ "HTTP/1.1 200 OK"
+2024-10-09 14:34:49 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:34:49 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:34:49 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:34:49 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:34:49 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:34:49 | ERROR | stderr |
+2024-10-09 14:34:49 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:34:49 | ERROR | stderr |
+2024-10-09 14:34:49 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:34:49 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:34:49 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:34:49 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:34:49 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:34:49 | ERROR | stderr | raise exc
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:34:49 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:34:49 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:34:49 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:34:49 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:49 | ERROR | stderr | raise exc
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:49 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:34:49 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:34:49 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:34:49 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:34:49 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:49 | ERROR | stderr | raise exc
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:49 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:34:49 | ERROR | stderr | response = await f(request)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:34:49 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:34:49 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:34:49 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:34:49 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:34:49 | ERROR | stderr | return [
+2024-10-09 14:34:49 | ERROR | stderr | ^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:34:49 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:34:49 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:34:49 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:34:49 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:34:49 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:34:49 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:34:49 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:49 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:34:49 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:34:49 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:34:49 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:49 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:34:49 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:34:49 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:49 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:34:49 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:49 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:34:49 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:34:49 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:34:49 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:49 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:49 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:34:49 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:34:49 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:49 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:34:49 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:34:49 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:34:49 | ERROR | stderr |
+2024-10-09 14:34:49 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:34:49 | ERROR | stderr |
+2024-10-09 14:34:49 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:34:54 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:34:54 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:34:54 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:34:54 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:34:54 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:34:54 | ERROR | stderr |
+2024-10-09 14:34:54 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:34:54 | ERROR | stderr |
+2024-10-09 14:34:54 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:34:54 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:34:54 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:34:54 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:34:54 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:34:54 | ERROR | stderr | raise exc
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:34:54 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:34:54 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:34:54 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:34:54 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:54 | ERROR | stderr | raise exc
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:54 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:34:54 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:34:54 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:34:54 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:34:54 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:54 | ERROR | stderr | raise exc
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:54 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:34:54 | ERROR | stderr | response = await f(request)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:34:54 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:34:54 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:34:54 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:34:54 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:34:54 | ERROR | stderr | return [
+2024-10-09 14:34:54 | ERROR | stderr | ^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:34:54 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:34:54 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:34:54 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:34:54 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:34:54 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:34:54 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:34:54 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:54 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:34:54 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:34:54 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:34:54 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:54 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:34:54 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:34:54 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:54 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:34:54 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:54 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:34:54 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:34:54 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:34:54 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:54 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:54 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:34:54 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:34:54 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:54 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:34:54 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:34:54 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:34:54 | ERROR | stderr |
+2024-10-09 14:34:54 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:34:54 | ERROR | stderr |
+2024-10-09 14:34:54 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:34:56 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:34:56 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:34:56 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:34:56 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:34:56 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:34:56 | ERROR | stderr |
+2024-10-09 14:34:56 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:34:56 | ERROR | stderr |
+2024-10-09 14:34:56 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:34:56 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | raise exc
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:34:56 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:56 | ERROR | stderr | raise exc
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:56 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:34:56 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:34:56 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:34:56 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:56 | ERROR | stderr | raise exc
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:56 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:34:56 | ERROR | stderr | response = await f(request)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:34:56 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:34:56 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:34:56 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:34:56 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:34:56 | ERROR | stderr | return [
+2024-10-09 14:34:56 | ERROR | stderr | ^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:34:56 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:34:56 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:34:56 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:34:56 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:34:56 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:34:56 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:34:56 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:34:56 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:34:56 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:34:56 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:34:56 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:56 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:34:56 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:34:56 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:34:56 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:56 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:34:56 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:34:56 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:34:56 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:34:56 | ERROR | stderr |
+2024-10-09 14:34:56 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:34:56 | ERROR | stderr |
+2024-10-09 14:34:56 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:34:56 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:34:56 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:34:56 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:34:56 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:34:56 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:34:56 | ERROR | stderr |
+2024-10-09 14:34:56 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:34:56 | ERROR | stderr |
+2024-10-09 14:34:56 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:34:56 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | raise exc
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:34:56 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:56 | ERROR | stderr | raise exc
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:56 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:34:56 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:34:56 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:34:56 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:56 | ERROR | stderr | raise exc
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:56 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:34:56 | ERROR | stderr | response = await f(request)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:34:56 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:34:56 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:34:56 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:34:56 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:34:56 | ERROR | stderr | return [
+2024-10-09 14:34:56 | ERROR | stderr | ^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:34:56 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:34:56 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:34:56 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:34:56 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:34:56 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:34:56 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:34:56 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:34:56 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:34:56 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:34:56 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:34:56 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:56 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:34:56 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:34:56 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:34:56 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:56 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:56 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:34:56 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:34:56 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:56 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:34:56 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:34:56 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:34:56 | ERROR | stderr |
+2024-10-09 14:34:56 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:34:56 | ERROR | stderr |
+2024-10-09 14:34:56 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:34:57 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:34:57 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:34:57 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:34:57 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:34:57 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:34:57 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | raise exc
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:34:57 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | raise exc
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:34:57 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:34:57 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:34:57 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | raise exc
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:34:57 | ERROR | stderr | response = await f(request)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:34:57 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:34:57 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:34:57 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:34:57 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:34:57 | ERROR | stderr | return [
+2024-10-09 14:34:57 | ERROR | stderr | ^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:34:57 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:34:57 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:34:57 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:34:57 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:34:57 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:34:57 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:34:57 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:34:57 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:34:57 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:34:57 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:57 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:34:57 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:34:57 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:34:57 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:57 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:34:57 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:34:57 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:34:57 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:34:57 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:34:57 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:34:57 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:34:57 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:34:57 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:34:57 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | raise exc
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:34:57 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | raise exc
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:34:57 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:34:57 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:34:57 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | raise exc
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:34:57 | ERROR | stderr | response = await f(request)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:34:57 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:34:57 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:34:57 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:34:57 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:34:57 | ERROR | stderr | return [
+2024-10-09 14:34:57 | ERROR | stderr | ^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:34:57 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:34:57 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:34:57 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:34:57 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:34:57 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:34:57 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:34:57 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:34:57 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:34:57 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:34:57 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:57 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:34:57 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:34:57 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:34:57 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:57 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:34:57 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:34:57 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:34:57 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:34:57 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:34:57 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:34:57 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:34:57 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:34:57 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:34:57 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | raise exc
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:34:57 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | raise exc
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:34:57 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:34:57 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:34:57 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | raise exc
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:34:57 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:34:57 | ERROR | stderr | response = await f(request)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:34:57 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:34:57 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:34:57 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:34:57 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:34:57 | ERROR | stderr | return [
+2024-10-09 14:34:57 | ERROR | stderr | ^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:34:57 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:34:57 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:34:57 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:34:57 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:34:57 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:34:57 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:34:57 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:34:57 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:34:57 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:34:57 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:57 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:34:57 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:34:57 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:34:57 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:34:57 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:34:57 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:34:57 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:34:57 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:34:57 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:34:57 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:34:57 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:34:57 | ERROR | stderr |
+2024-10-09 14:34:57 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:35:03 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:35:03 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:35:03 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:35:03 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:35:03 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:35:03 | ERROR | stderr |
+2024-10-09 14:35:03 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:35:03 | ERROR | stderr |
+2024-10-09 14:35:03 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:35:03 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:35:03 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:35:03 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:35:03 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:35:03 | ERROR | stderr | raise exc
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:35:03 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:35:03 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:35:03 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:35:03 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:35:03 | ERROR | stderr | raise exc
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:35:03 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:35:03 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:35:03 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:35:03 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:35:03 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:35:03 | ERROR | stderr | raise exc
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:35:03 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:35:03 | ERROR | stderr | response = await f(request)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:35:03 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:35:03 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:35:03 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:35:03 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:35:03 | ERROR | stderr | return [
+2024-10-09 14:35:03 | ERROR | stderr | ^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:35:03 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:35:03 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:35:03 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:35:03 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:35:03 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:35:03 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:35:03 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:35:03 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:35:03 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:35:03 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:35:03 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:35:03 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:03 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:35:04 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:35:04 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:35:04 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:35:04 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:35:04 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:35:04 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:35:04 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:35:04 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:35:04 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:35:04 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:35:04 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:35:04 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:35:04 | ERROR | stderr |
+2024-10-09 14:35:04 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:35:04 | ERROR | stderr |
+2024-10-09 14:35:04 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:35:04 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:35:04 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:35:04 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:35:04 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:35:04 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:35:04 | ERROR | stderr |
+2024-10-09 14:35:04 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:35:04 | ERROR | stderr |
+2024-10-09 14:35:04 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:35:04 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | raise exc
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:35:04 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:35:04 | ERROR | stderr | raise exc
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:35:04 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:35:04 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:35:04 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:35:04 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:35:04 | ERROR | stderr | raise exc
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:35:04 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:35:04 | ERROR | stderr | response = await f(request)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:35:04 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:35:04 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:35:04 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:35:04 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:35:04 | ERROR | stderr | return [
+2024-10-09 14:35:04 | ERROR | stderr | ^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:35:04 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:35:04 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:35:04 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:35:04 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:35:04 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:35:04 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:35:04 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:35:04 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:35:04 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:35:04 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:35:04 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:35:04 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:35:04 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:35:04 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:35:04 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:35:04 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:35:04 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:35:04 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:35:04 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:35:04 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:35:04 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:35:04 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:35:04 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:04 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:35:04 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:35:04 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:35:04 | ERROR | stderr |
+2024-10-09 14:35:04 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:35:04 | ERROR | stderr |
+2024-10-09 14:35:04 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:35:06 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:35:06 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:35:06 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:35:06 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:35:06 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:35:06 | ERROR | stderr |
+2024-10-09 14:35:06 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:35:06 | ERROR | stderr |
+2024-10-09 14:35:06 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:35:06 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:35:06 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:35:06 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:35:06 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:35:06 | ERROR | stderr | raise exc
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:35:06 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:35:06 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:35:06 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:35:06 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:35:06 | ERROR | stderr | raise exc
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:35:06 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:35:06 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:35:06 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:35:06 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:35:06 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:35:06 | ERROR | stderr | raise exc
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:35:06 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:35:06 | ERROR | stderr | response = await f(request)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:35:06 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:35:06 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:35:06 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:35:06 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:35:06 | ERROR | stderr | return [
+2024-10-09 14:35:06 | ERROR | stderr | ^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:35:06 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:35:06 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:35:06 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:35:06 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:35:06 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:35:06 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:35:06 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:35:06 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:35:06 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:35:06 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:35:06 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:35:06 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:35:06 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:35:06 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:35:06 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:35:06 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:35:06 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:35:06 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:35:06 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:35:06 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:35:06 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:35:06 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:35:06 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:35:06 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:35:06 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:35:06 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:35:06 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:35:06 | ERROR | stderr |
+2024-10-09 14:35:06 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:35:06 | ERROR | stderr |
+2024-10-09 14:35:06 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:38:19 | INFO | stdout | Changes detected in: /Users/geminigby/PycharmProjects/llava_demo/UGround/llava/serve/gradio_web_server.py
+2024-10-09 14:38:19 | ERROR | stderr | Exception in thread Thread-5:
+2024-10-09 14:38:19 | ERROR | stderr | Exception in thread Thread-5:
+2024-10-09 14:38:19 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:38:19 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:38:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
+2024-10-09 14:38:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
+2024-10-09 14:38:19 | ERROR | stderr | self.run()
+2024-10-09 14:38:19 | ERROR | stderr | self.run()
+2024-10-09 14:38:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 982, in run
+2024-10-09 14:38:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 982, in run
+2024-10-09 14:38:19 | ERROR | stderr | self._target(*self._args, **self._kwargs)
+2024-10-09 14:38:19 | ERROR | stderr | self._target(*self._args, **self._kwargs)
+2024-10-09 14:38:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/gradio/utils.py", line 218, in watchfn
+2024-10-09 14:38:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/gradio/utils.py", line 218, in watchfn
+2024-10-09 14:38:19 | ERROR | stderr | demo = getattr(module, reloader.demo_name)
+2024-10-09 14:38:19 | ERROR | stderr | demo = getattr(module, reloader.demo_name)
+2024-10-09 14:38:19 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:38:19 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:38:19 | ERROR | stderr | AttributeError: module 'app' has no attribute 'demo'
+2024-10-09 14:38:19 | ERROR | stderr | AttributeError: module 'app' has no attribute 'demo'
+2024-10-09 14:38:20 | INFO | stdout | Keyboard interruption in main thread... closing server.
+2024-10-09 14:38:20 | INFO | stdout | Keyboard interruption in main thread... closing server.
+2024-10-09 14:38:28 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:38:28 | INFO | stdout | Starting the controller
+2024-10-09 14:38:28 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:38:28 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:38:28 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-8bit']
+2024-10-09 14:38:38 | INFO | stdout | name 'model_selector' is not defined
+2024-10-09 14:38:38 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:38:38 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:38:38 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:38:38 | INFO | stdout | --------
+2024-10-09 14:38:38 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
+2024-10-09 14:39:51 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:39:51 | INFO | stdout | Starting the controller
+2024-10-09 14:39:51 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:39:51 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:39:51 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-8bit']
+2024-10-09 14:40:02 | INFO | stdout | name 'model_selector' is not defined
+2024-10-09 14:40:02 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:40:02 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:40:02 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:40:02 | INFO | stdout | --------
+2024-10-09 14:40:02 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
+2024-10-09 14:40:32 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:40:32 | INFO | stdout | Starting the controller
+2024-10-09 14:40:32 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:40:32 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:40:32 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-8bit']
+2024-10-09 14:40:42 | ERROR | stderr | /Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/gradio/components/dropdown.py:163: UserWarning: The value passed into gr.Dropdown() is not in the list of choices. Please update the list of choices to include: or set allow_custom_value=True.
+2024-10-09 14:40:42 | ERROR | stderr | warnings.warn(
+2024-10-09 14:40:42 | INFO | stdout | Running on local URL: http://0.0.0.0:7860
+2024-10-09 14:40:42 | INFO | httpx | HTTP Request: GET http://localhost:7860/startup-events "HTTP/1.1 200 OK"
+2024-10-09 14:40:42 | INFO | httpx | HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
+2024-10-09 14:40:42 | INFO | stdout |
+2024-10-09 14:40:42 | INFO | stdout | To create a public link, set `share=True` in `launch()`.
+2024-10-09 14:40:42 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:40:42 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:40:42 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:40:42 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:40:42 | INFO | stdout | --------
+2024-10-09 14:40:42 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
+2024-10-09 14:40:43 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-launched-telemetry/ "HTTP/1.1 200 OK"
+2024-10-09 14:40:50 | ERROR | stderr | [31mERROR[0m: Exception in ASGI application
+2024-10-09 14:40:50 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
+2024-10-09 14:40:50 | ERROR | stderr | self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
+2024-10-09 14:40:50 | ERROR | stderr | raise AttributeError(attribute)
+2024-10-09 14:40:50 | ERROR | stderr | AttributeError: __pydantic_core_schema__
+2024-10-09 14:40:50 | ERROR | stderr |
+2024-10-09 14:40:50 | ERROR | stderr | During handling of the above exception, another exception occurred:
+2024-10-09 14:40:50 | ERROR | stderr |
+2024-10-09 14:40:50 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
+2024-10-09 14:40:50 | ERROR | stderr | result = await app( # type: ignore[func-returns-value]
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
+2024-10-09 14:40:50 | ERROR | stderr | return await self.app(scope, receive, send)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
+2024-10-09 14:40:50 | ERROR | stderr | await super().__call__(scope, receive, send)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
+2024-10-09 14:40:50 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
+2024-10-09 14:40:50 | ERROR | stderr | raise exc
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
+2024-10-09 14:40:50 | ERROR | stderr | await self.app(scope, receive, _send)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
+2024-10-09 14:40:50 | ERROR | stderr | await self.simple_response(scope, receive, send, request_headers=headers)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
+2024-10-09 14:40:50 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
+2024-10-09 14:40:50 | ERROR | stderr | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:40:50 | ERROR | stderr | raise exc
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:40:50 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
+2024-10-09 14:40:50 | ERROR | stderr | await self.middleware_stack(scope, receive, send)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
+2024-10-09 14:40:50 | ERROR | stderr | await route.handle(scope, receive, send)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
+2024-10-09 14:40:50 | ERROR | stderr | await self.app(scope, receive, send)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
+2024-10-09 14:40:50 | ERROR | stderr | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
+2024-10-09 14:40:50 | ERROR | stderr | raise exc
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
+2024-10-09 14:40:50 | ERROR | stderr | await app(scope, receive, sender)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
+2024-10-09 14:40:50 | ERROR | stderr | response = await f(request)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
+2024-10-09 14:40:50 | ERROR | stderr | solved_result = await solve_dependencies(
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
+2024-10-09 14:40:50 | ERROR | stderr | ) = await request_body_to_args( # body_params checked above
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
+2024-10-09 14:40:50 | ERROR | stderr | fields_to_extract = get_cached_model_fields(first_field.type_)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
+2024-10-09 14:40:50 | ERROR | stderr | return get_model_fields(model)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
+2024-10-09 14:40:50 | ERROR | stderr | return [
+2024-10-09 14:40:50 | ERROR | stderr | ^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in
+2024-10-09 14:40:50 | ERROR | stderr | ModelField(field_info=field_info, name=name)
+2024-10-09 14:40:50 | ERROR | stderr | File "", line 6, in __init__
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
+2024-10-09 14:40:50 | ERROR | stderr | self._type_adapter: TypeAdapter[Any] = TypeAdapter(
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
+2024-10-09 14:40:50 | ERROR | stderr | self._init_core_attrs(rebuild_mocks=False)
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
+2024-10-09 14:40:50 | ERROR | stderr | return func(self, *args, **kwargs)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
+2024-10-09 14:40:50 | ERROR | stderr | self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
+2024-10-09 14:40:50 | ERROR | stderr | schema = gen.generate_schema(type_)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:40:50 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
+2024-10-09 14:40:50 | ERROR | stderr | return self._annotated_schema(obj)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
+2024-10-09 14:40:50 | ERROR | stderr | schema = self._apply_annotations(source_type, annotations)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
+2024-10-09 14:40:50 | ERROR | stderr | schema = get_inner_schema(source_type)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:40:50 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
+2024-10-09 14:40:50 | ERROR | stderr | schema = metadata_get_schema(source, get_inner_schema)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in
+2024-10-09 14:40:50 | ERROR | stderr | lambda source, handler: handler(source)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
+2024-10-09 14:40:50 | ERROR | stderr | schema = self._handler(source_type)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
+2024-10-09 14:40:50 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:40:50 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
+2024-10-09 14:40:50 | ERROR | stderr | return self._match_generic_type(obj, origin)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
+2024-10-09 14:40:50 | ERROR | stderr | return self._union_schema(obj)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
+2024-10-09 14:40:50 | ERROR | stderr | choices.append(self.generate_schema(arg))
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
+2024-10-09 14:40:50 | ERROR | stderr | schema = self._generate_schema_inner(obj)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
+2024-10-09 14:40:50 | ERROR | stderr | return self.match_type(obj)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
+2024-10-09 14:40:50 | ERROR | stderr | return self._unknown_type_schema(obj)
+2024-10-09 14:40:50 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:40:50 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
+2024-10-09 14:40:50 | ERROR | stderr | raise PydanticSchemaGenerationError(
+2024-10-09 14:40:50 | ERROR | stderr | pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for . Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.
+2024-10-09 14:40:50 | ERROR | stderr |
+2024-10-09 14:40:50 | ERROR | stderr | If you got this error by calling handler() within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema()` since we do not call `__get_pydantic_core_schema__` on `` otherwise to avoid infinite recursion.
+2024-10-09 14:40:50 | ERROR | stderr |
+2024-10-09 14:40:50 | ERROR | stderr | For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
+2024-10-09 14:42:19 | INFO | stdout | Changes detected in: /Users/geminigby/PycharmProjects/llava_demo/UGround/llava/serve/gradio_web_server.py
+2024-10-09 14:42:19 | ERROR | stderr | Exception in thread Thread-5:
+2024-10-09 14:42:19 | ERROR | stderr | Exception in thread Thread-5:
+2024-10-09 14:42:19 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:42:19 | ERROR | stderr | Traceback (most recent call last):
+2024-10-09 14:42:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
+2024-10-09 14:42:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
+2024-10-09 14:42:19 | ERROR | stderr | self.run()
+2024-10-09 14:42:19 | ERROR | stderr | self.run()
+2024-10-09 14:42:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 982, in run
+2024-10-09 14:42:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/threading.py", line 982, in run
+2024-10-09 14:42:19 | ERROR | stderr | self._target(*self._args, **self._kwargs)
+2024-10-09 14:42:19 | ERROR | stderr | self._target(*self._args, **self._kwargs)
+2024-10-09 14:42:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/gradio/utils.py", line 218, in watchfn
+2024-10-09 14:42:19 | ERROR | stderr | File "/Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/gradio/utils.py", line 218, in watchfn
+2024-10-09 14:42:19 | ERROR | stderr | demo = getattr(module, reloader.demo_name)
+2024-10-09 14:42:19 | ERROR | stderr | demo = getattr(module, reloader.demo_name)
+2024-10-09 14:42:19 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:42:19 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2024-10-09 14:42:19 | ERROR | stderr | AttributeError: module 'app' has no attribute 'demo'
+2024-10-09 14:42:19 | ERROR | stderr | AttributeError: module 'app' has no attribute 'demo'
+2024-10-09 14:47:47 | INFO | stdout | Keyboard interruption in main thread... closing server.
+2024-10-09 14:47:47 | INFO | stdout | Keyboard interruption in main thread... closing server.
+2024-10-09 14:47:53 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:47:53 | INFO | stdout | Starting the controller
+2024-10-09 14:47:53 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:47:53 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:47:53 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-8bit']
+2024-10-09 14:48:03 | INFO | stdout | 'str' object has no attribute '_id'
+2024-10-09 14:48:03 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:48:04 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:48:04 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:48:04 | INFO | stdout | --------
+2024-10-09 14:48:04 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
+2024-10-09 14:50:54 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:50:54 | INFO | stdout | Starting the controller
+2024-10-09 14:50:54 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:50:54 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:50:54 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-8bit']
+2024-10-09 14:51:04 | ERROR | stderr | /Users/geminigby/miniconda3/envs/UGround/lib/python3.11/site-packages/gradio/components/dropdown.py:163: UserWarning: The value passed into gr.Dropdown() is not in the list of choices. Please update the list of choices to include: or set allow_custom_value=True.
+2024-10-09 14:51:04 | ERROR | stderr | warnings.warn(
+2024-10-09 14:51:04 | INFO | stdout | 'int' object has no attribute '_id'
+2024-10-09 14:51:04 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:51:05 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:51:05 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:51:05 | INFO | stdout | --------
+2024-10-09 14:51:05 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
+2024-10-09 14:51:42 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:51:42 | INFO | stdout | Starting the controller
+2024-10-09 14:51:42 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:51:42 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:51:42 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-8bit']
+2024-10-09 14:51:52 | INFO | stdout | list index out of range
+2024-10-09 14:51:52 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:51:52 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:51:52 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:51:52 | INFO | stdout | --------
+2024-10-09 14:51:52 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
+2024-10-09 14:53:02 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:53:02 | INFO | stdout | Starting the controller
+2024-10-09 14:53:02 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:53:02 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:53:02 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-8bit']
+2024-10-09 14:53:13 | INFO | stdout | list index out of range
+2024-10-09 14:53:13 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:53:13 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:53:13 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:53:13 | INFO | stdout | --------
+2024-10-09 14:53:13 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
+2024-10-09 14:53:55 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:53:55 | INFO | stdout | Starting the controller
+2024-10-09 14:53:55 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:53:55 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:53:55 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-8bit']
+2024-10-09 14:54:06 | INFO | stdout | list index out of range
+2024-10-09 14:54:06 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:54:06 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:54:06 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:54:06 | INFO | stdout | --------
+2024-10-09 14:54:06 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
+2024-10-09 14:54:35 | INFO | stdout | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=1, model_list_mode='reload', share=False, moderate=False, embed=False)
+2024-10-09 14:54:35 | INFO | stdout | Starting the controller
+2024-10-09 14:54:35 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.controller', '--host', '0.0.0.0', '--port', '10000']
+2024-10-09 14:54:35 | INFO | stdout | Starting the model worker for the model osunlp/UGround
+2024-10-09 14:54:35 | INFO | stdout | ['/Users/geminigby/miniconda3/envs/UGround/bin/python', '-m', 'llava.serve.model_worker', '--host', '0.0.0.0', '--controller', 'http://localhost:10000', '--model-path', 'osunlp/UGround', '--model-name', 'llava-v1.5-UGround_v1', '--use-flash-attn', '--load-8bit']
+2024-10-09 14:54:45 | INFO | stdout | list index out of range
+2024-10-09 14:54:45 | INFO | httpx | HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
+2024-10-09 14:54:45 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
+2024-10-09 14:54:45 | INFO | stdout | IMPORTANT: You are using gradio version 4.16.0, however version 4.29.0 is available, please upgrade.
+2024-10-09 14:54:45 | INFO | stdout | --------
+2024-10-09 14:54:45 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
diff --git a/llava/__init__.py b/llava/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..841b5bc202236baf5678513f2fa05b1d9b285ae4
--- /dev/null
+++ b/llava/__init__.py
@@ -0,0 +1,2 @@
+from .model import LlavaLlamaForCausalLM
+# from .model.language_model.llava_llama import LlavaLlamaForCausalLM
\ No newline at end of file
diff --git a/llava/__pycache__/__init__.cpython-311.pyc b/llava/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..67fdff39352a0026ac361db023a5c3b6ba43a463
Binary files /dev/null and b/llava/__pycache__/__init__.cpython-311.pyc differ
diff --git a/llava/__pycache__/constants.cpython-311.pyc b/llava/__pycache__/constants.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..21aa624277b8beae337df77eeadb7a4225d03bd1
Binary files /dev/null and b/llava/__pycache__/constants.cpython-311.pyc differ
diff --git a/llava/__pycache__/conversation.cpython-311.pyc b/llava/__pycache__/conversation.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..62779716fdae2fdaf1976bee311244f86125389e
Binary files /dev/null and b/llava/__pycache__/conversation.cpython-311.pyc differ
diff --git a/llava/__pycache__/mm_utils.cpython-311.pyc b/llava/__pycache__/mm_utils.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..13ddc2b86c04210ffa67a65938ed79a5dd901cc3
Binary files /dev/null and b/llava/__pycache__/mm_utils.cpython-311.pyc differ
diff --git a/llava/__pycache__/utils.cpython-311.pyc b/llava/__pycache__/utils.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fbf49f760a2434710b0265f594149c26445997c6
Binary files /dev/null and b/llava/__pycache__/utils.cpython-311.pyc differ
diff --git a/llava/constants.py b/llava/constants.py
new file mode 100644
index 0000000000000000000000000000000000000000..374be090510b302de9882d880c755787a8eafe11
--- /dev/null
+++ b/llava/constants.py
@@ -0,0 +1,13 @@
+CONTROLLER_HEART_BEAT_EXPIRATION = 30
+WORKER_HEART_BEAT_INTERVAL = 15
+
+LOGDIR = "."
+
+# Model Constants
+IGNORE_INDEX = -100
+IMAGE_TOKEN_INDEX = -200
+DEFAULT_IMAGE_TOKEN = ""
+DEFAULT_IMAGE_PATCH_TOKEN = ""
+DEFAULT_IM_START_TOKEN = ""
+DEFAULT_IM_END_TOKEN = ""
+IMAGE_PLACEHOLDER = ""
diff --git a/llava/conversation.py b/llava/conversation.py
new file mode 100644
index 0000000000000000000000000000000000000000..42450e03210806f05d8b8438abed6d9c7e04718a
--- /dev/null
+++ b/llava/conversation.py
@@ -0,0 +1,418 @@
+import dataclasses
+from enum import auto, Enum
+from typing import List, Tuple
+import base64
+from io import BytesIO
+from PIL import Image
+
+
+class SeparatorStyle(Enum):
+ """Different separator style."""
+ SINGLE = auto()
+ TWO = auto()
+ MPT = auto()
+ PLAIN = auto()
+ LLAMA_2 = auto()
+
+
+@dataclasses.dataclass
+class Conversation:
+ """A class that keeps all conversation history."""
+ system: str
+ roles: List[str]
+ messages: List[List[str]]
+ offset: int
+ sep_style: SeparatorStyle = SeparatorStyle.SINGLE
+ sep: str = "###"
+ sep2: str = None
+ version: str = "Unknown"
+
+ skip_next: bool = False
+
+ def get_prompt(self):
+ messages = [self.messages[0],self.messages[-1]]
+ if len(messages) > 0 and type(messages[0][1]) is tuple:
+ messages = self.messages.copy()
+ init_role, init_msg = messages[0].copy()
+ init_msg = init_msg[0].replace("", "").strip()
+ if 'mmtag' in self.version:
+ messages[0] = (init_role, init_msg)
+ messages.insert(0, (self.roles[0], ""))
+ messages.insert(1, (self.roles[1], "Received."))
+ else:
+ messages[0] = (init_role, "\n" + init_msg)
+
+ if self.sep_style == SeparatorStyle.SINGLE:
+ ret = self.system + self.sep
+ for role, message in messages:
+ if message:
+ if type(message) is tuple:
+ message, _, _ = message
+ ret += role + ": " + message + self.sep
+ else:
+ ret += role + ":"
+ elif self.sep_style == SeparatorStyle.TWO:
+ seps = [self.sep, self.sep2]
+ ret = self.system + seps[0]
+ for i, (role, message) in enumerate(messages):
+ if message:
+ if type(message) is tuple:
+ message, _, _ = message
+ ret += role + ": " + message + seps[i % 2]
+ else:
+ ret += role + ":"
+ elif self.sep_style == SeparatorStyle.MPT:
+ ret = self.system + self.sep
+ for role, message in messages:
+ if message:
+ if type(message) is tuple:
+ message, _, _ = message
+ ret += role + message + self.sep
+ else:
+ ret += role
+ elif self.sep_style == SeparatorStyle.LLAMA_2:
+ wrap_sys = lambda msg: f"<>\n{msg}\n<>\n\n" if len(msg) > 0 else msg
+ wrap_inst = lambda msg: f"[INST] {msg} [/INST]"
+ ret = ""
+
+ for i, (role, message) in enumerate(messages):
+ if i == 0:
+ assert message, "first message should not be none"
+ assert role == self.roles[0], "first message should come from user"
+ if message:
+ if type(message) is tuple:
+ message, _, _ = message
+ if i == 0: message = wrap_sys(self.system) + message
+ if i % 2 == 0:
+ message = wrap_inst(message)
+ ret += self.sep + message
+ else:
+ ret += " " + message + " " + self.sep2
+ else:
+ ret += ""
+ ret = ret.lstrip(self.sep)
+ elif self.sep_style == SeparatorStyle.PLAIN:
+ seps = [self.sep, self.sep2]
+ ret = self.system
+ for i, (role, message) in enumerate(messages):
+ if message:
+ if type(message) is tuple:
+ message, _, _ = message
+ ret += message + seps[i % 2]
+ else:
+ ret += ""
+ else:
+ raise ValueError(f"Invalid style: {self.sep_style}")
+
+ return ret
+
+ def append_message(self, role, message):
+ self.messages.append([role, message])
+
+ def pop_message(self, role, message):
+ self.messages.pop()
+
+ def process_image(self, image, image_process_mode, return_pil=False, image_format='PNG', max_len=1344, min_len=672):
+ if image_process_mode == "Pad":
+ def expand2square(pil_img, background_color=(122, 116, 104)):
+ width, height = pil_img.size
+ if width == height:
+ return pil_img
+ elif width > height:
+ result = Image.new(pil_img.mode, (width, width), background_color)
+ result.paste(pil_img, (0, (width - height) // 2))
+ return result
+ else:
+ result = Image.new(pil_img.mode, (height, height), background_color)
+ result.paste(pil_img, ((height - width) // 2, 0))
+ return result
+ image = expand2square(image)
+ elif image_process_mode in ["Default", "Crop"]:
+ pass
+ elif image_process_mode == "Resize":
+ image = image.resize((336, 336))
+ else:
+ raise ValueError(f"Invalid image_process_mode: {image_process_mode}")
+ if max(image.size) > max_len:
+ max_hw, min_hw = max(image.size), min(image.size)
+ aspect_ratio = max_hw / min_hw
+ shortest_edge = int(min(max_len / aspect_ratio, min_len, min_hw))
+ longest_edge = int(shortest_edge * aspect_ratio)
+ W, H = image.size
+ if H > W:
+ H, W = longest_edge, shortest_edge
+ else:
+ H, W = shortest_edge, longest_edge
+ image = image.resize((W, H))
+ if return_pil:
+ return image
+ else:
+ buffered = BytesIO()
+ image.save(buffered, format=image_format)
+ img_b64_str = base64.b64encode(buffered.getvalue()).decode()
+ return img_b64_str
+
+ def get_images(self, return_pil=False):
+ images = []
+ for i, (role, msg) in enumerate(self.messages[self.offset:]):
+ if i % 2 == 0:
+ if type(msg) is tuple:
+ msg, image, image_process_mode = msg
+ image = self.process_image(image, image_process_mode, return_pil=return_pil)
+ images.append(image)
+ return images
+
+ def to_gradio_chatbot(self,extra_image=None):
+ ret = []
+ for i, (role, msg) in enumerate(reversed(self.messages[self.offset:])):
+ if role==self.roles[0]:
+ pass
+ # if type(msg) is tuple:
+ # msg, image, image_process_mode = msg
+ # img_b64_str = self.process_image(
+ # image, "Default", return_pil=False,
+ # image_format='JPEG')
+ # img_str = f''
+ # msg = img_str + msg.replace('', '').strip()
+ # ret.append([msg, None])
+ # else:
+ # ret.append([msg, None])
+ elif role==self.roles[1]:
+ if extra_image==None:
+ if type(msg) is tuple:
+ msg, image, image_process_mode = msg
+ img_b64_str = self.process_image(
+ image, "Default", return_pil=False,
+ image_format='JPEG')
+ img_str = f''
+ msg = img_str +msg
+ ret.append([msg, None])
+ else:
+ ret.append([msg, None])
+ else:
+ img_b64_str = self.process_image(
+ extra_image, "Default", return_pil=False,
+ image_format='JPEG')
+ img_str = f''
+ msg=img_str
+ ret.append([msg, None])
+ break
+ return ret
+
+ def copy(self):
+ return Conversation(
+ system=self.system,
+ roles=self.roles,
+ messages=[[x, y] for x, y in self.messages],
+ offset=self.offset,
+ sep_style=self.sep_style,
+ sep=self.sep,
+ sep2=self.sep2,
+ version=self.version)
+
+ def dict(self):
+ if len(self.get_images()) > 0:
+ return {
+ "system": self.system,
+ "roles": self.roles,
+ "messages": [[x, y[0] if type(y) is tuple else y] for x, y in self.messages],
+ "offset": self.offset,
+ "sep": self.sep,
+ "sep2": self.sep2,
+ }
+ return {
+ "system": self.system,
+ "roles": self.roles,
+ "messages": self.messages,
+ "offset": self.offset,
+ "sep": self.sep,
+ "sep2": self.sep2,
+ }
+
+
+conv_vicuna_v0 = Conversation(
+ system="A chat between a curious human and an artificial intelligence assistant. "
+ "The assistant gives helpful, detailed, and polite answers to the human's questions.",
+ roles=("Human", "Assistant"),
+ messages=(
+ ("Human", "What are the key differences between renewable and non-renewable energy sources?"),
+ ("Assistant",
+ "Renewable energy sources are those that can be replenished naturally in a relatively "
+ "short amount of time, such as solar, wind, hydro, geothermal, and biomass. "
+ "Non-renewable energy sources, on the other hand, are finite and will eventually be "
+ "depleted, such as coal, oil, and natural gas. Here are some key differences between "
+ "renewable and non-renewable energy sources:\n"
+ "1. Availability: Renewable energy sources are virtually inexhaustible, while non-renewable "
+ "energy sources are finite and will eventually run out.\n"
+ "2. Environmental impact: Renewable energy sources have a much lower environmental impact "
+ "than non-renewable sources, which can lead to air and water pollution, greenhouse gas emissions, "
+ "and other negative effects.\n"
+ "3. Cost: Renewable energy sources can be more expensive to initially set up, but they typically "
+ "have lower operational costs than non-renewable sources.\n"
+ "4. Reliability: Renewable energy sources are often more reliable and can be used in more remote "
+ "locations than non-renewable sources.\n"
+ "5. Flexibility: Renewable energy sources are often more flexible and can be adapted to different "
+ "situations and needs, while non-renewable sources are more rigid and inflexible.\n"
+ "6. Sustainability: Renewable energy sources are more sustainable over the long term, while "
+ "non-renewable sources are not, and their depletion can lead to economic and social instability.\n")
+ ),
+ offset=2,
+ sep_style=SeparatorStyle.SINGLE,
+ sep="###",
+)
+
+conv_vicuna_v1 = Conversation(
+ system="A chat between a curious user and an artificial intelligence assistant. "
+ "The assistant gives helpful, detailed, and polite answers to the user's questions.",
+ roles=("USER", "ASSISTANT"),
+ version="v1",
+ messages=(),
+ offset=0,
+ sep_style=SeparatorStyle.TWO,
+ sep=" ",
+ sep2="",
+)
+
+conv_llama_2 = Conversation(
+ system="""You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
+
+If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.""",
+ roles=("USER", "ASSISTANT"),
+ version="llama_v2",
+ messages=(),
+ offset=0,
+ sep_style=SeparatorStyle.LLAMA_2,
+ sep="",
+ sep2="",
+)
+
+conv_llava_llama_2 = Conversation(
+ system="You are a helpful language and vision assistant. "
+ "You are able to understand the visual content that the user provides, "
+ "and assist the user with a variety of tasks using natural language.",
+ roles=("USER", "ASSISTANT"),
+ version="llama_v2",
+ messages=(),
+ offset=0,
+ sep_style=SeparatorStyle.LLAMA_2,
+ sep="",
+ sep2="",
+)
+
+conv_mpt = Conversation(
+ system="""<|im_start|>system
+A conversation between a user and an LLM-based AI assistant. The assistant gives helpful and honest answers.""",
+ roles=("<|im_start|>user\n", "<|im_start|>assistant\n"),
+ version="mpt",
+ messages=(),
+ offset=0,
+ sep_style=SeparatorStyle.MPT,
+ sep="<|im_end|>",
+)
+
+conv_llava_plain = Conversation(
+ system="",
+ roles=("", ""),
+ messages=(
+ ),
+ offset=0,
+ sep_style=SeparatorStyle.PLAIN,
+ sep="\n",
+)
+
+conv_llava_v0 = Conversation(
+ system="A chat between a curious human and an artificial intelligence assistant. "
+ "The assistant gives helpful, detailed, and polite answers to the human's questions.",
+ roles=("Human", "Assistant"),
+ messages=(
+ ),
+ offset=0,
+ sep_style=SeparatorStyle.SINGLE,
+ sep="###",
+)
+
+conv_llava_v0_mmtag = Conversation(
+ system="A chat between a curious user and an artificial intelligence assistant. "
+ "The assistant is able to understand the visual content that the user provides, and assist the user with a variety of tasks using natural language."
+ "The visual content will be provided with the following format: visual content.",
+ roles=("Human", "Assistant"),
+ messages=(
+ ),
+ offset=0,
+ sep_style=SeparatorStyle.SINGLE,
+ sep="###",
+ version="v0_mmtag",
+)
+
+conv_llava_v1 = Conversation(
+ system="A chat between a curious human and an artificial intelligence assistant. "
+ "The assistant gives helpful, detailed, and polite answers to the human's questions.",
+ roles=("USER", "ASSISTANT"),
+ version="v1",
+ messages=(),
+ offset=0,
+ sep_style=SeparatorStyle.TWO,
+ sep=" ",
+ sep2="",
+)
+
+conv_llava_v1_mmtag = Conversation(
+ system="A chat between a curious user and an artificial intelligence assistant. "
+ "The assistant is able to understand the visual content that the user provides, and assist the user with a variety of tasks using natural language."
+ "The visual content will be provided with the following format: visual content.",
+ roles=("USER", "ASSISTANT"),
+ messages=(),
+ offset=0,
+ sep_style=SeparatorStyle.TWO,
+ sep=" ",
+ sep2="",
+ version="v1_mmtag",
+)
+
+conv_mistral_instruct = Conversation(
+ system="",
+ roles=("USER", "ASSISTANT"),
+ version="llama_v2",
+ messages=(),
+ offset=0,
+ sep_style=SeparatorStyle.LLAMA_2,
+ sep="",
+ sep2="",
+)
+
+conv_chatml_direct = Conversation(
+ system="""<|im_start|>system
+Answer the questions.""",
+ roles=("<|im_start|>user\n", "<|im_start|>assistant\n"),
+ version="mpt",
+ messages=(),
+ offset=0,
+ sep_style=SeparatorStyle.MPT,
+ sep="<|im_end|>",
+)
+
+default_conversation = conv_llava_v1
+conv_templates = {
+ "default": conv_vicuna_v0,
+ "v0": conv_vicuna_v0,
+ "v1": conv_vicuna_v1,
+ "vicuna_v1": conv_vicuna_v1,
+ "llama_2": conv_llama_2,
+ "mistral_instruct": conv_mistral_instruct,
+ "chatml_direct": conv_chatml_direct,
+ "mistral_direct": conv_chatml_direct,
+
+ "plain": conv_llava_plain,
+ "v0_plain": conv_llava_plain,
+ "llava_v0": conv_llava_v0,
+ "v0_mmtag": conv_llava_v0_mmtag,
+ "llava_v1": conv_llava_v1,
+ "v1_mmtag": conv_llava_v1_mmtag,
+ "llava_llama_2": conv_llava_llama_2,
+
+ "mpt": conv_mpt,
+}
+
+
+if __name__ == "__main__":
+ print(default_conversation.get_prompt())
diff --git a/llava/eval/Roboto-Black.ttf b/llava/eval/Roboto-Black.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..0112e7da626ca2f959eca850c806779ba55dbfbd
Binary files /dev/null and b/llava/eval/Roboto-Black.ttf differ
diff --git a/llava/eval/Roboto-BlackItalic.ttf b/llava/eval/Roboto-BlackItalic.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..b2c6aca57bc0d92ab3197d595766bf9285deea00
Binary files /dev/null and b/llava/eval/Roboto-BlackItalic.ttf differ
diff --git a/llava/eval/Roboto-Bold.ttf b/llava/eval/Roboto-Bold.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..43da14d84ecb949ca5f5e8ecca3a514aa7fe1c7d
Binary files /dev/null and b/llava/eval/Roboto-Bold.ttf differ
diff --git a/llava/eval/Roboto-BoldItalic.ttf b/llava/eval/Roboto-BoldItalic.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..bcfdab4311f2201f45b341b36310e1cdb8051e34
Binary files /dev/null and b/llava/eval/Roboto-BoldItalic.ttf differ
diff --git a/llava/eval/Roboto-Italic.ttf b/llava/eval/Roboto-Italic.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..1b5eaa361c7306b4246c48497c79475c0e05c5e2
Binary files /dev/null and b/llava/eval/Roboto-Italic.ttf differ
diff --git a/llava/eval/Roboto-Light.ttf b/llava/eval/Roboto-Light.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..e7307e72c5e7bced5d36c776d0986bf71b605f15
Binary files /dev/null and b/llava/eval/Roboto-Light.ttf differ
diff --git a/llava/eval/Roboto-LightItalic.ttf b/llava/eval/Roboto-LightItalic.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..2d277afb231f7613a49d983217c1aba871741433
Binary files /dev/null and b/llava/eval/Roboto-LightItalic.ttf differ
diff --git a/llava/eval/Roboto-Medium.ttf b/llava/eval/Roboto-Medium.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..ac0f908b9c9c73da558b45d65cc5c6094874d3e8
Binary files /dev/null and b/llava/eval/Roboto-Medium.ttf differ
diff --git a/llava/eval/Roboto-MediumItalic.ttf b/llava/eval/Roboto-MediumItalic.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..fc36a4785c50c04c9b18260e4709cda077ed352d
Binary files /dev/null and b/llava/eval/Roboto-MediumItalic.ttf differ
diff --git a/llava/eval/Roboto-Regular.ttf b/llava/eval/Roboto-Regular.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..ddf4bfacb396e97546364ccfeeb9c31dfaea4c25
Binary files /dev/null and b/llava/eval/Roboto-Regular.ttf differ
diff --git a/llava/eval/Roboto-Thin.ttf b/llava/eval/Roboto-Thin.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..2e0dee6a833c4b568d44ac99727f7e0c17c6eb67
Binary files /dev/null and b/llava/eval/Roboto-Thin.ttf differ
diff --git a/llava/eval/Roboto-ThinItalic.ttf b/llava/eval/Roboto-ThinItalic.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..084f9c0f5365952d4d860431a1c2dca147e4a9b5
Binary files /dev/null and b/llava/eval/Roboto-ThinItalic.ttf differ
diff --git a/llava/eval/eval_gpt_review.py b/llava/eval/eval_gpt_review.py
new file mode 100644
index 0000000000000000000000000000000000000000..8af4559c65fc2728b11fd2097a109981ee1ef686
--- /dev/null
+++ b/llava/eval/eval_gpt_review.py
@@ -0,0 +1,113 @@
+import argparse
+import json
+import os
+
+import openai
+import tqdm
+import ray
+import time
+
+NUM_SECONDS_TO_SLEEP = 3
+
+@ray.remote(num_cpus=4)
+def get_eval(content: str, max_tokens: int):
+ while True:
+ try:
+ response = openai.ChatCompletion.create(
+ model='gpt-4',
+ messages=[{
+ 'role': 'system',
+ 'content': 'You are a helpful and precise assistant for checking the quality of the answer.'
+ }, {
+ 'role': 'user',
+ 'content': content,
+ }],
+ temperature=0.2, # TODO: figure out which temperature is best for evaluation
+ max_tokens=max_tokens,
+ )
+ break
+ except openai.error.RateLimitError:
+ pass
+ except Exception as e:
+ print(e)
+ time.sleep(NUM_SECONDS_TO_SLEEP)
+
+ print('success!')
+ return response['choices'][0]['message']['content']
+
+
+def parse_score(review):
+ try:
+ score_pair = review.split('\n')[0]
+ score_pair = score_pair.replace(',', ' ')
+ sp = score_pair.split(' ')
+ if len(sp) == 2:
+ return [float(sp[0]), float(sp[1])]
+ else:
+ print('error', review)
+ return [-1, -1]
+ except Exception as e:
+ print(e)
+ print('error', review)
+ return [-1, -1]
+
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(description='ChatGPT-based QA evaluation.')
+ parser.add_argument('-q', '--question')
+ # parser.add_argument('-a', '--answer')
+ parser.add_argument('-a', '--answer-list', nargs='+', default=[])
+ parser.add_argument('-r', '--rule')
+ parser.add_argument('-o', '--output')
+ parser.add_argument('--max-tokens', type=int, default=1024, help='maximum number of tokens produced in the output')
+ args = parser.parse_args()
+
+ ray.init()
+
+ f_q = open(os.path.expanduser(args.question))
+ f_ans1 = open(os.path.expanduser(args.answer_list[0]))
+ f_ans2 = open(os.path.expanduser(args.answer_list[1]))
+ rule_dict = json.load(open(os.path.expanduser(args.rule), 'r'))
+
+ review_file = open(f'{args.output}', 'w')
+
+ js_list = []
+ handles = []
+ idx = 0
+ for ques_js, ans1_js, ans2_js in zip(f_q, f_ans1, f_ans2):
+ # if idx == 1:
+ # break
+
+ ques = json.loads(ques_js)
+ ans1 = json.loads(ans1_js)
+ ans2 = json.loads(ans2_js)
+
+ category = json.loads(ques_js)['category']
+ if category in rule_dict:
+ rule = rule_dict[category]
+ else:
+ rule = rule_dict['default']
+ prompt = rule['prompt']
+ role = rule['role']
+ content = (f'[Question]\n{ques["text"]}\n\n'
+ f'[{role} 1]\n{ans1["text"]}\n\n[End of {role} 1]\n\n'
+ f'[{role} 2]\n{ans2["text"]}\n\n[End of {role} 2]\n\n'
+ f'[System]\n{prompt}\n\n')
+ js_list.append({
+ 'id': idx+1,
+ 'question_id': ques['question_id'],
+ 'answer1_id': ans1['answer_id'],
+ 'answer2_id': ans2['answer_id'],
+ 'category': category})
+ idx += 1
+ handles.append(get_eval.remote(content, args.max_tokens))
+ # To avoid the rate limit set by OpenAI
+ time.sleep(NUM_SECONDS_TO_SLEEP)
+
+ reviews = ray.get(handles)
+ for idx, review in enumerate(reviews):
+ scores = parse_score(review)
+ js_list[idx]['content'] = review
+ js_list[idx]['tuple'] = scores
+ review_file.write(json.dumps(js_list[idx]) + '\n')
+ review_file.close()
diff --git a/llava/eval/eval_gpt_review_bench.py b/llava/eval/eval_gpt_review_bench.py
new file mode 100644
index 0000000000000000000000000000000000000000..06160f2422b5368f30fb967f7cae635208a1dc69
--- /dev/null
+++ b/llava/eval/eval_gpt_review_bench.py
@@ -0,0 +1,121 @@
+import argparse
+import json
+import os
+
+import openai
+import time
+
+NUM_SECONDS_TO_SLEEP = 0.5
+
+
+def get_eval(content: str, max_tokens: int):
+ while True:
+ try:
+ response = openai.ChatCompletion.create(
+ model='gpt-4-0314',
+ messages=[{
+ 'role': 'system',
+ 'content': 'You are a helpful and precise assistant for checking the quality of the answer.'
+ }, {
+ 'role': 'user',
+ 'content': content,
+ }],
+ temperature=0.2, # TODO: figure out which temperature is best for evaluation
+ max_tokens=max_tokens,
+ )
+ break
+ except openai.error.RateLimitError:
+ pass
+ except Exception as e:
+ print(e)
+ time.sleep(NUM_SECONDS_TO_SLEEP)
+
+ return response['choices'][0]['message']['content']
+
+
+def parse_score(review):
+ try:
+ score_pair = review.split('\n')[0]
+ score_pair = score_pair.replace(',', ' ')
+ sp = score_pair.split(' ')
+ if len(sp) == 2:
+ return [float(sp[0]), float(sp[1])]
+ else:
+ print('error', review)
+ return [-1, -1]
+ except Exception as e:
+ print(e)
+ print('error', review)
+ return [-1, -1]
+
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(description='ChatGPT-based QA evaluation.')
+ parser.add_argument('-q', '--question')
+ parser.add_argument('-c', '--context')
+ parser.add_argument('-a', '--answer-list', nargs='+', default=[])
+ parser.add_argument('-r', '--rule')
+ parser.add_argument('-o', '--output')
+ parser.add_argument('--max-tokens', type=int, default=1024, help='maximum number of tokens produced in the output')
+ args = parser.parse_args()
+
+ f_q = open(os.path.expanduser(args.question))
+ f_ans1 = open(os.path.expanduser(args.answer_list[0]))
+ f_ans2 = open(os.path.expanduser(args.answer_list[1]))
+ rule_dict = json.load(open(os.path.expanduser(args.rule), 'r'))
+
+ if os.path.isfile(os.path.expanduser(args.output)):
+ cur_reviews = [json.loads(line) for line in open(os.path.expanduser(args.output))]
+ else:
+ cur_reviews = []
+
+ review_file = open(f'{args.output}', 'a')
+
+ context_list = [json.loads(line) for line in open(os.path.expanduser(args.context))]
+ image_to_context = {context['image']: context for context in context_list}
+
+ handles = []
+ idx = 0
+ for ques_js, ans1_js, ans2_js in zip(f_q, f_ans1, f_ans2):
+ ques = json.loads(ques_js)
+ ans1 = json.loads(ans1_js)
+ ans2 = json.loads(ans2_js)
+
+ inst = image_to_context[ques['image']]
+
+ if isinstance(inst['caption'], list):
+ cap_str = '\n'.join(inst['caption'])
+ else:
+ cap_str = inst['caption']
+
+ category = 'llava_bench_' + json.loads(ques_js)['category']
+ if category in rule_dict:
+ rule = rule_dict[category]
+ else:
+ assert False, f"Visual QA category not found in rule file: {category}."
+ prompt = rule['prompt']
+ role = rule['role']
+ content = (f'[Context]\n{cap_str}\n\n'
+ f'[Question]\n{ques["text"]}\n\n'
+ f'[{role} 1]\n{ans1["text"]}\n\n[End of {role} 1]\n\n'
+ f'[{role} 2]\n{ans2["text"]}\n\n[End of {role} 2]\n\n'
+ f'[System]\n{prompt}\n\n')
+ cur_js = {
+ 'id': idx+1,
+ 'question_id': ques['question_id'],
+ 'answer1_id': ans1.get('answer_id', ans1['question_id']),
+ 'answer2_id': ans2.get('answer_id', ans2['answer_id']),
+ 'category': category
+ }
+ if idx >= len(cur_reviews):
+ review = get_eval(content, args.max_tokens)
+ scores = parse_score(review)
+ cur_js['content'] = review
+ cur_js['tuple'] = scores
+ review_file.write(json.dumps(cur_js) + '\n')
+ review_file.flush()
+ else:
+ print(f'Skipping {idx} as we already have it.')
+ idx += 1
+ print(idx)
+ review_file.close()
diff --git a/llava/eval/eval_gpt_review_visual.py b/llava/eval/eval_gpt_review_visual.py
new file mode 100644
index 0000000000000000000000000000000000000000..d6e407a400a67020d801e6c27a3c32a2ee38f30c
--- /dev/null
+++ b/llava/eval/eval_gpt_review_visual.py
@@ -0,0 +1,118 @@
+import argparse
+import json
+import os
+
+import openai
+import time
+
+NUM_SECONDS_TO_SLEEP = 0.5
+
+
+def get_eval(content: str, max_tokens: int):
+ while True:
+ try:
+ response = openai.ChatCompletion.create(
+ model='gpt-4-0314',
+ messages=[{
+ 'role': 'system',
+ 'content': 'You are a helpful and precise assistant for checking the quality of the answer.'
+ }, {
+ 'role': 'user',
+ 'content': content,
+ }],
+ temperature=0.2, # TODO: figure out which temperature is best for evaluation
+ max_tokens=max_tokens,
+ )
+ break
+ except openai.error.RateLimitError:
+ pass
+ except Exception as e:
+ print(e)
+ time.sleep(NUM_SECONDS_TO_SLEEP)
+
+ return response['choices'][0]['message']['content']
+
+
+def parse_score(review):
+ try:
+ score_pair = review.split('\n')[0]
+ score_pair = score_pair.replace(',', ' ')
+ sp = score_pair.split(' ')
+ if len(sp) == 2:
+ return [float(sp[0]), float(sp[1])]
+ else:
+ print('error', review)
+ return [-1, -1]
+ except Exception as e:
+ print(e)
+ print('error', review)
+ return [-1, -1]
+
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(description='ChatGPT-based QA evaluation.')
+ parser.add_argument('-q', '--question')
+ parser.add_argument('-c', '--context')
+ parser.add_argument('-a', '--answer-list', nargs='+', default=[])
+ parser.add_argument('-r', '--rule')
+ parser.add_argument('-o', '--output')
+ parser.add_argument('--max-tokens', type=int, default=1024, help='maximum number of tokens produced in the output')
+ args = parser.parse_args()
+
+ f_q = open(os.path.expanduser(args.question))
+ f_ans1 = open(os.path.expanduser(args.answer_list[0]))
+ f_ans2 = open(os.path.expanduser(args.answer_list[1]))
+ rule_dict = json.load(open(os.path.expanduser(args.rule), 'r'))
+
+ if os.path.isfile(os.path.expanduser(args.output)):
+ cur_reviews = [json.loads(line) for line in open(os.path.expanduser(args.output))]
+ else:
+ cur_reviews = []
+
+ review_file = open(f'{args.output}', 'a')
+
+ context_list = [json.loads(line) for line in open(os.path.expanduser(args.context))]
+ image_to_context = {context['image']: context for context in context_list}
+
+ handles = []
+ idx = 0
+ for ques_js, ans1_js, ans2_js in zip(f_q, f_ans1, f_ans2):
+ ques = json.loads(ques_js)
+ ans1 = json.loads(ans1_js)
+ ans2 = json.loads(ans2_js)
+
+ inst = image_to_context[ques['image']]
+ cap_str = '\n'.join(inst['captions'])
+ box_str = '\n'.join([f'{instance["category"]}: {instance["bbox"]}' for instance in inst['instances']])
+
+ category = json.loads(ques_js)['category']
+ if category in rule_dict:
+ rule = rule_dict[category]
+ else:
+ assert False, f"Visual QA category not found in rule file: {category}."
+ prompt = rule['prompt']
+ role = rule['role']
+ content = (f'[Context]\n{cap_str}\n\n{box_str}\n\n'
+ f'[Question]\n{ques["text"]}\n\n'
+ f'[{role} 1]\n{ans1["text"]}\n\n[End of {role} 1]\n\n'
+ f'[{role} 2]\n{ans2["text"]}\n\n[End of {role} 2]\n\n'
+ f'[System]\n{prompt}\n\n')
+ cur_js = {
+ 'id': idx+1,
+ 'question_id': ques['question_id'],
+ 'answer1_id': ans1.get('answer_id', ans1['question_id']),
+ 'answer2_id': ans2.get('answer_id', ans2['answer_id']),
+ 'category': category
+ }
+ if idx >= len(cur_reviews):
+ review = get_eval(content, args.max_tokens)
+ scores = parse_score(review)
+ cur_js['content'] = review
+ cur_js['tuple'] = scores
+ review_file.write(json.dumps(cur_js) + '\n')
+ review_file.flush()
+ else:
+ print(f'Skipping {idx} as we already have it.')
+ idx += 1
+ print(idx)
+ review_file.close()
diff --git a/llava/eval/eval_pope.py b/llava/eval/eval_pope.py
new file mode 100644
index 0000000000000000000000000000000000000000..b115b8f2327ea9d972f9e41bcbb03c68be6b3508
--- /dev/null
+++ b/llava/eval/eval_pope.py
@@ -0,0 +1,81 @@
+import os
+import json
+import argparse
+
+def eval_pope(answers, label_file):
+ label_list = [json.loads(q)['label'] for q in open(label_file, 'r')]
+
+ for answer in answers:
+ text = answer['text']
+
+ # Only keep the first sentence
+ if text.find('.') != -1:
+ text = text.split('.')[0]
+
+ text = text.replace(',', '')
+ words = text.split(' ')
+ if 'No' in words or 'not' in words or 'no' in words:
+ answer['text'] = 'no'
+ else:
+ answer['text'] = 'yes'
+
+ for i in range(len(label_list)):
+ if label_list[i] == 'no':
+ label_list[i] = 0
+ else:
+ label_list[i] = 1
+
+ pred_list = []
+ for answer in answers:
+ if answer['text'] == 'no':
+ pred_list.append(0)
+ else:
+ pred_list.append(1)
+
+ pos = 1
+ neg = 0
+ yes_ratio = pred_list.count(1) / len(pred_list)
+
+ TP, TN, FP, FN = 0, 0, 0, 0
+ for pred, label in zip(pred_list, label_list):
+ if pred == pos and label == pos:
+ TP += 1
+ elif pred == pos and label == neg:
+ FP += 1
+ elif pred == neg and label == neg:
+ TN += 1
+ elif pred == neg and label == pos:
+ FN += 1
+
+ print('TP\tFP\tTN\tFN\t')
+ print('{}\t{}\t{}\t{}'.format(TP, FP, TN, FN))
+
+ precision = float(TP) / float(TP + FP)
+ recall = float(TP) / float(TP + FN)
+ f1 = 2*precision*recall / (precision + recall)
+ acc = (TP + TN) / (TP + TN + FP + FN)
+ print('Accuracy: {}'.format(acc))
+ print('Precision: {}'.format(precision))
+ print('Recall: {}'.format(recall))
+ print('F1 score: {}'.format(f1))
+ print('Yes ratio: {}'.format(yes_ratio))
+ print('%.3f, %.3f, %.3f, %.3f, %.3f' % (f1, acc, precision, recall, yes_ratio) )
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--annotation-dir", type=str)
+ parser.add_argument("--question-file", type=str)
+ parser.add_argument("--result-file", type=str)
+ args = parser.parse_args()
+
+ questions = [json.loads(line) for line in open(args.question_file)]
+ questions = {question['question_id']: question for question in questions}
+ answers = [json.loads(q) for q in open(args.result_file)]
+ for file in os.listdir(args.annotation_dir):
+ assert file.startswith('coco_pope_')
+ assert file.endswith('.json')
+ category = file[10:-5]
+ cur_answers = [x for x in answers if questions[x['question_id']]['category'] == category]
+ print('Category: {}, # samples: {}'.format(category, len(cur_answers)))
+ eval_pope(cur_answers, os.path.join(args.annotation_dir, file))
+ print("====================================")
diff --git a/llava/eval/eval_science_qa.py b/llava/eval/eval_science_qa.py
new file mode 100644
index 0000000000000000000000000000000000000000..ccf206bbd7a5d6376eef82d61b3ef8bbe0f71c6c
--- /dev/null
+++ b/llava/eval/eval_science_qa.py
@@ -0,0 +1,114 @@
+import argparse
+import json
+import os
+import re
+import random
+
+
+def get_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--base-dir', type=str)
+ parser.add_argument('--result-file', type=str)
+ parser.add_argument('--output-file', type=str)
+ parser.add_argument('--output-result', type=str)
+ parser.add_argument('--split', type=str, default='test')
+ parser.add_argument('--options', type=list, default=["A", "B", "C", "D", "E"])
+ return parser.parse_args()
+
+
+def convert_caps(results):
+ fakecaps = []
+ for result in results:
+ image_id = result['question_id']
+ caption = result['text']
+ fakecaps.append({"image_id": int(image_id), "caption": caption})
+ return fakecaps
+
+
+def get_pred_idx(prediction, choices, options):
+ """
+ Get the index (e.g. 2) from the prediction (e.g. 'C')
+ """
+ if prediction in options[:len(choices)]:
+ return options.index(prediction)
+ else:
+ return -1
+ return random.choice(range(len(choices)))
+
+
+if __name__ == "__main__":
+ args = get_args()
+
+ base_dir = args.base_dir
+ split_indices = json.load(open(os.path.join(base_dir, "pid_splits.json")))[args.split]
+ problems = json.load(open(os.path.join(base_dir, "problems.json")))
+ predictions = [json.loads(line) for line in open(args.result_file)]
+ predictions = {pred['question_id']: pred for pred in predictions}
+ split_problems = {idx: problems[idx] for idx in split_indices}
+
+ results = {'correct': [], 'incorrect': []}
+ sqa_results = {}
+ sqa_results['acc'] = None
+ sqa_results['correct'] = None
+ sqa_results['count'] = None
+ sqa_results['results'] = {}
+ sqa_results['outputs'] = {}
+
+ for prob_id, prob in split_problems.items():
+ if prob_id not in predictions:
+ pred = {'text': 'FAILED', 'prompt': 'Unknown'}
+ pred_text = 'FAILED'
+ else:
+ pred = predictions[prob_id]
+ pred_text = pred['text']
+
+ if pred_text in args.options:
+ answer = pred_text
+ elif len(pred_text) >= 3 and pred_text[0] in args.options and pred_text[1:3] == ". ":
+ answer = pred_text[0]
+ else:
+ pattern = re.compile(r'The answer is ([A-Z]).')
+ res = pattern.findall(pred_text)
+ if len(res) == 1:
+ answer = res[0] # 'A', 'B', ...
+ else:
+ answer = "FAILED"
+
+ pred_idx = get_pred_idx(answer, prob['choices'], args.options)
+
+ analysis = {
+ 'question_id': prob_id,
+ 'parsed_ans': answer,
+ 'ground_truth': args.options[prob['answer']],
+ 'question': pred['prompt'],
+ 'pred': pred_text,
+ 'is_multimodal': '' in pred['prompt'],
+ }
+
+ sqa_results['results'][prob_id] = get_pred_idx(answer, prob['choices'], args.options)
+ sqa_results['outputs'][prob_id] = pred_text
+
+ if pred_idx == prob['answer']:
+ results['correct'].append(analysis)
+ else:
+ results['incorrect'].append(analysis)
+
+ correct = len(results['correct'])
+ total = len(results['correct']) + len(results['incorrect'])
+
+ ###### IMG ######
+ multimodal_correct = len([x for x in results['correct'] if x['is_multimodal']])
+ multimodal_incorrect = len([x for x in results['incorrect'] if x['is_multimodal']])
+ multimodal_total = multimodal_correct + multimodal_incorrect
+ ###### IMG ######
+
+ print(f'Total: {total}, Correct: {correct}, Accuracy: {correct / total * 100:.2f}%, IMG-Accuracy: {multimodal_correct / multimodal_total * 100:.2f}%')
+
+ sqa_results['acc'] = correct / total * 100
+ sqa_results['correct'] = correct
+ sqa_results['count'] = total
+
+ with open(args.output_file, 'w') as f:
+ json.dump(results, f, indent=2)
+ with open(args.output_result, 'w') as f:
+ json.dump(sqa_results, f, indent=2)
diff --git a/llava/eval/eval_science_qa_gpt4.py b/llava/eval/eval_science_qa_gpt4.py
new file mode 100644
index 0000000000000000000000000000000000000000..c2ff17c915481fb556aba6ec816a9e08f519c515
--- /dev/null
+++ b/llava/eval/eval_science_qa_gpt4.py
@@ -0,0 +1,104 @@
+import argparse
+import json
+import os
+import re
+import random
+from collections import defaultdict
+
+
+def get_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--base-dir', type=str)
+ parser.add_argument('--gpt4-result', type=str)
+ parser.add_argument('--our-result', type=str)
+ parser.add_argument('--split', type=str, default='test')
+ parser.add_argument('--options', type=list, default=["A", "B", "C", "D", "E"])
+ return parser.parse_args()
+
+
+def convert_caps(results):
+ fakecaps = []
+ for result in results:
+ image_id = result['question_id']
+ caption = result['text']
+ fakecaps.append({"image_id": int(image_id), "caption": caption})
+ return fakecaps
+
+
+def get_pred_idx(prediction, choices, options):
+ """
+ Get the index (e.g. 2) from the prediction (e.g. 'C')
+ """
+ if prediction in options[:len(choices)]:
+ return options.index(prediction)
+ else:
+ return random.choice(range(len(choices)))
+
+
+if __name__ == "__main__":
+ args = get_args()
+
+ base_dir = args.base_dir
+ split_indices = json.load(open(os.path.join(base_dir, "pid_splits.json")))[args.split]
+ problems = json.load(open(os.path.join(base_dir, "problems.json")))
+ our_predictions = [json.loads(line) for line in open(args.our_result)]
+ our_predictions = {pred['question_id']: pred for pred in our_predictions}
+ split_problems = {idx: problems[idx] for idx in split_indices}
+
+ gpt4_predictions = json.load(open(args.gpt4_result))['outputs']
+
+ results = defaultdict(lambda: 0)
+
+ for prob_id, prob in split_problems.items():
+ if prob_id not in our_predictions:
+ continue
+ if prob_id not in gpt4_predictions:
+ continue
+ our_pred = our_predictions[prob_id]['text']
+ gpt4_pred = gpt4_predictions[prob_id]
+
+ pattern = re.compile(r'The answer is ([A-Z]).')
+ our_res = pattern.findall(our_pred)
+ if len(our_res) == 1:
+ our_answer = our_res[0] # 'A', 'B', ...
+ else:
+ our_answer = "FAILED"
+ gpt4_res = pattern.findall(gpt4_pred)
+ if len(gpt4_res) == 1:
+ gpt4_answer = gpt4_res[0] # 'A', 'B', ...
+ else:
+ gpt4_answer = "FAILED"
+
+ our_pred_idx = get_pred_idx(our_answer, prob['choices'], args.options)
+ gpt4_pred_idx = get_pred_idx(gpt4_answer, prob['choices'], args.options)
+
+ if gpt4_answer == 'FAILED':
+ results['gpt4_failed'] += 1
+ # continue
+ gpt4_pred_idx = our_pred_idx
+ # if our_pred_idx != prob['answer']:
+ # print(our_predictions[prob_id]['prompt'])
+ # print('-----------------')
+ # print(f'LECTURE: {prob["lecture"]}')
+ # print(f'SOLUTION: {prob["solution"]}')
+ # print('=====================')
+ else:
+ # continue
+ pass
+ # gpt4_pred_idx = our_pred_idx
+
+ if gpt4_pred_idx == prob['answer']:
+ results['correct'] += 1
+ else:
+ results['incorrect'] += 1
+
+
+ if gpt4_pred_idx == prob['answer'] or our_pred_idx == prob['answer']:
+ results['correct_upperbound'] += 1
+
+ correct = results['correct']
+ total = results['correct'] + results['incorrect']
+ print(f'Total: {total}, Correct: {correct}, Accuracy: {correct / total * 100:.2f}%')
+ print(f'Total: {total}, Correct (upper): {results["correct_upperbound"]}, Accuracy: {results["correct_upperbound"] / total * 100:.2f}%')
+ print(f'Total: {total}, GPT-4 NO-ANS (RANDOM): {results["gpt4_failed"]}, Percentage: {results["gpt4_failed"] / total * 100:.2f}%')
+
diff --git a/llava/eval/eval_science_qa_gpt4_requery.py b/llava/eval/eval_science_qa_gpt4_requery.py
new file mode 100644
index 0000000000000000000000000000000000000000..698546e995d365d1ccc2c25a87e6c5cd681e6eb6
--- /dev/null
+++ b/llava/eval/eval_science_qa_gpt4_requery.py
@@ -0,0 +1,149 @@
+import argparse
+import json
+import os
+import re
+import random
+from collections import defaultdict
+
+
+def get_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--base-dir', type=str)
+ parser.add_argument('--gpt4-result', type=str)
+ parser.add_argument('--requery-result', type=str)
+ parser.add_argument('--our-result', type=str)
+ parser.add_argument('--output-result', type=str)
+ parser.add_argument('--split', type=str, default='test')
+ parser.add_argument('--options', type=list, default=["A", "B", "C", "D", "E"])
+ return parser.parse_args()
+
+
+def convert_caps(results):
+ fakecaps = []
+ for result in results:
+ image_id = result['question_id']
+ caption = result['text']
+ fakecaps.append({"image_id": int(image_id), "caption": caption})
+ return fakecaps
+
+
+def get_pred_idx(prediction, choices, options):
+ """
+ Get the index (e.g. 2) from the prediction (e.g. 'C')
+ """
+ if prediction in options[:len(choices)]:
+ return options.index(prediction)
+ else:
+ return random.choice(range(len(choices)))
+
+
+if __name__ == "__main__":
+ args = get_args()
+
+ base_dir = args.base_dir
+ split_indices = json.load(open(os.path.join(base_dir, "pid_splits.json")))[args.split]
+ problems = json.load(open(os.path.join(base_dir, "problems.json")))
+ our_predictions = [json.loads(line) for line in open(args.our_result)]
+ our_predictions = {pred['question_id']: pred for pred in our_predictions}
+ split_problems = {idx: problems[idx] for idx in split_indices}
+
+ requery_predictions = [json.loads(line) for line in open(args.requery_result)]
+ requery_predictions = {pred['question_id']: pred for pred in requery_predictions}
+
+ gpt4_predictions = json.load(open(args.gpt4_result))['outputs']
+
+ results = defaultdict(lambda: 0)
+
+ sqa_results = {}
+ sqa_results['acc'] = None
+ sqa_results['correct'] = None
+ sqa_results['count'] = None
+ sqa_results['results'] = {}
+ sqa_results['outputs'] = {}
+
+ for prob_id, prob in split_problems.items():
+ if prob_id not in our_predictions:
+ assert False
+ if prob_id not in gpt4_predictions:
+ assert False
+ our_pred = our_predictions[prob_id]['text']
+ gpt4_pred = gpt4_predictions[prob_id]
+ if prob_id not in requery_predictions:
+ results['missing_requery'] += 1
+ requery_pred = "MISSING"
+ else:
+ requery_pred = requery_predictions[prob_id]['text']
+
+ pattern = re.compile(r'The answer is ([A-Z]).')
+ our_res = pattern.findall(our_pred)
+ if len(our_res) == 1:
+ our_answer = our_res[0] # 'A', 'B', ...
+ else:
+ our_answer = "FAILED"
+
+ requery_res = pattern.findall(requery_pred)
+ if len(requery_res) == 1:
+ requery_answer = requery_res[0] # 'A', 'B', ...
+ else:
+ requery_answer = "FAILED"
+
+ gpt4_res = pattern.findall(gpt4_pred)
+ if len(gpt4_res) == 1:
+ gpt4_answer = gpt4_res[0] # 'A', 'B', ...
+ else:
+ gpt4_answer = "FAILED"
+
+ our_pred_idx = get_pred_idx(our_answer, prob['choices'], args.options)
+ gpt4_pred_idx = get_pred_idx(gpt4_answer, prob['choices'], args.options)
+ requery_pred_idx = get_pred_idx(requery_answer, prob['choices'], args.options)
+
+ results['total'] += 1
+
+ if gpt4_answer == 'FAILED':
+ results['gpt4_failed'] += 1
+ if gpt4_pred_idx == prob['answer']:
+ results['gpt4_correct'] += 1
+ if our_pred_idx == prob['answer']:
+ results['gpt4_ourvisual_correct'] += 1
+ elif gpt4_pred_idx == prob['answer']:
+ results['gpt4_correct'] += 1
+ results['gpt4_ourvisual_correct'] += 1
+
+ if our_pred_idx == prob['answer']:
+ results['our_correct'] += 1
+
+ if requery_answer == 'FAILED':
+ sqa_results['results'][prob_id] = our_pred_idx
+ if our_pred_idx == prob['answer']:
+ results['requery_correct'] += 1
+ else:
+ sqa_results['results'][prob_id] = requery_pred_idx
+ if requery_pred_idx == prob['answer']:
+ results['requery_correct'] += 1
+ else:
+ print(f"""
+Question ({args.options[prob['answer']]}): {our_predictions[prob_id]['prompt']}
+Our ({our_answer}): {our_pred}
+GPT-4 ({gpt4_answer}): {gpt4_pred}
+Requery ({requery_answer}): {requery_pred}
+print("=====================================")
+""")
+
+ if gpt4_pred_idx == prob['answer'] or our_pred_idx == prob['answer']:
+ results['correct_upperbound'] += 1
+
+ total = results['total']
+ print(f'Total: {total}, Our-Correct: {results["our_correct"]}, Accuracy: {results["our_correct"] / total * 100:.2f}%')
+ print(f'Total: {total}, GPT-4-Correct: {results["gpt4_correct"]}, Accuracy: {results["gpt4_correct"] / total * 100:.2f}%')
+ print(f'Total: {total}, GPT-4 NO-ANS (RANDOM): {results["gpt4_failed"]}, Percentage: {results["gpt4_failed"] / total * 100:.2f}%')
+ print(f'Total: {total}, GPT-4-OursVisual-Correct: {results["gpt4_ourvisual_correct"]}, Accuracy: {results["gpt4_ourvisual_correct"] / total * 100:.2f}%')
+ print(f'Total: {total}, Requery-Correct: {results["requery_correct"]}, Accuracy: {results["requery_correct"] / total * 100:.2f}%')
+ print(f'Total: {total}, Correct upper: {results["correct_upperbound"]}, Accuracy: {results["correct_upperbound"] / total * 100:.2f}%')
+
+ sqa_results['acc'] = results["requery_correct"] / total * 100
+ sqa_results['correct'] = results["requery_correct"]
+ sqa_results['count'] = total
+
+ with open(args.output_result, 'w') as f:
+ json.dump(sqa_results, f, indent=2)
+
diff --git a/llava/eval/eval_textvqa.py b/llava/eval/eval_textvqa.py
new file mode 100644
index 0000000000000000000000000000000000000000..468f4bb120448a036bd5b5c7955464fe2e13892a
--- /dev/null
+++ b/llava/eval/eval_textvqa.py
@@ -0,0 +1,65 @@
+import os
+import argparse
+import json
+import re
+
+from llava.eval.m4c_evaluator import TextVQAAccuracyEvaluator
+
+
+def get_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--annotation-file', type=str)
+ parser.add_argument('--result-file', type=str)
+ parser.add_argument('--result-dir', type=str)
+ return parser.parse_args()
+
+
+def prompt_processor(prompt):
+ if prompt.startswith('OCR tokens: '):
+ pattern = r"Question: (.*?) Short answer:"
+ match = re.search(pattern, prompt, re.DOTALL)
+ question = match.group(1)
+ elif 'Reference OCR token: ' in prompt and len(prompt.split('\n')) == 3:
+ if prompt.startswith('Reference OCR token:'):
+ question = prompt.split('\n')[1]
+ else:
+ question = prompt.split('\n')[0]
+ elif len(prompt.split('\n')) == 2:
+ question = prompt.split('\n')[0]
+ else:
+ assert False
+
+ return question.lower()
+
+
+def eval_single(annotation_file, result_file):
+ experiment_name = os.path.splitext(os.path.basename(result_file))[0]
+ print(experiment_name)
+ annotations = json.load(open(annotation_file))['data']
+ annotations = {(annotation['image_id'], annotation['question'].lower()): annotation for annotation in annotations}
+ results = [json.loads(line) for line in open(result_file)]
+
+ pred_list = []
+ for result in results:
+ annotation = annotations[(result['question_id'], prompt_processor(result['prompt']))]
+ pred_list.append({
+ "pred_answer": result['text'],
+ "gt_answers": annotation['answers'],
+ })
+
+ evaluator = TextVQAAccuracyEvaluator()
+ print('Samples: {}\nAccuracy: {:.2f}%\n'.format(len(pred_list), 100. * evaluator.eval_pred_list(pred_list)))
+
+
+if __name__ == "__main__":
+ args = get_args()
+
+ if args.result_file is not None:
+ eval_single(args.annotation_file, args.result_file)
+
+ if args.result_dir is not None:
+ for result_file in sorted(os.listdir(args.result_dir)):
+ if not result_file.endswith('.jsonl'):
+ print(f'Skipping {result_file}')
+ continue
+ eval_single(args.annotation_file, os.path.join(args.result_dir, result_file))
diff --git a/llava/eval/generate_webpage_data_from_table.py b/llava/eval/generate_webpage_data_from_table.py
new file mode 100644
index 0000000000000000000000000000000000000000..92602258ccd953a1d7137056aaf15c8de8166e21
--- /dev/null
+++ b/llava/eval/generate_webpage_data_from_table.py
@@ -0,0 +1,111 @@
+"""Generate json file for webpage."""
+import json
+import os
+import re
+
+# models = ['llama', 'alpaca', 'gpt35', 'bard']
+models = ['vicuna']
+
+
+def read_jsonl(path: str, key: str=None):
+ data = []
+ with open(os.path.expanduser(path)) as f:
+ for line in f:
+ if not line:
+ continue
+ data.append(json.loads(line))
+ if key is not None:
+ data.sort(key=lambda x: x[key])
+ data = {item[key]: item for item in data}
+ return data
+
+
+def trim_hanging_lines(s: str, n: int) -> str:
+ s = s.strip()
+ for _ in range(n):
+ s = s.split('\n', 1)[1].strip()
+ return s
+
+
+if __name__ == '__main__':
+ questions = read_jsonl('table/question.jsonl', key='question_id')
+
+ # alpaca_answers = read_jsonl('table/answer/answer_alpaca-13b.jsonl', key='question_id')
+ # bard_answers = read_jsonl('table/answer/answer_bard.jsonl', key='question_id')
+ # gpt35_answers = read_jsonl('table/answer/answer_gpt35.jsonl', key='question_id')
+ # llama_answers = read_jsonl('table/answer/answer_llama-13b.jsonl', key='question_id')
+ vicuna_answers = read_jsonl('table/answer/answer_vicuna-13b.jsonl', key='question_id')
+ ours_answers = read_jsonl('table/results/llama-13b-hf-alpaca.jsonl', key='question_id')
+
+ review_vicuna = read_jsonl('table/review/review_vicuna-13b_llama-13b-hf-alpaca.jsonl', key='question_id')
+ # review_alpaca = read_jsonl('table/review/review_alpaca-13b_vicuna-13b.jsonl', key='question_id')
+ # review_bard = read_jsonl('table/review/review_bard_vicuna-13b.jsonl', key='question_id')
+ # review_gpt35 = read_jsonl('table/review/review_gpt35_vicuna-13b.jsonl', key='question_id')
+ # review_llama = read_jsonl('table/review/review_llama-13b_vicuna-13b.jsonl', key='question_id')
+
+ records = []
+ for qid in questions.keys():
+ r = {
+ 'id': qid,
+ 'category': questions[qid]['category'],
+ 'question': questions[qid]['text'],
+ 'answers': {
+ # 'alpaca': alpaca_answers[qid]['text'],
+ # 'llama': llama_answers[qid]['text'],
+ # 'bard': bard_answers[qid]['text'],
+ # 'gpt35': gpt35_answers[qid]['text'],
+ 'vicuna': vicuna_answers[qid]['text'],
+ 'ours': ours_answers[qid]['text'],
+ },
+ 'evaluations': {
+ # 'alpaca': review_alpaca[qid]['text'],
+ # 'llama': review_llama[qid]['text'],
+ # 'bard': review_bard[qid]['text'],
+ 'vicuna': review_vicuna[qid]['content'],
+ # 'gpt35': review_gpt35[qid]['text'],
+ },
+ 'scores': {
+ 'vicuna': review_vicuna[qid]['tuple'],
+ # 'alpaca': review_alpaca[qid]['score'],
+ # 'llama': review_llama[qid]['score'],
+ # 'bard': review_bard[qid]['score'],
+ # 'gpt35': review_gpt35[qid]['score'],
+ },
+ }
+
+ # cleanup data
+ cleaned_evals = {}
+ for k, v in r['evaluations'].items():
+ v = v.strip()
+ lines = v.split('\n')
+ # trim the first line if it's a pair of numbers
+ if re.match(r'\d+[, ]+\d+', lines[0]):
+ lines = lines[1:]
+ v = '\n'.join(lines)
+ cleaned_evals[k] = v.replace('Assistant 1', "**Assistant 1**").replace('Assistant 2', '**Assistant 2**')
+
+ r['evaluations'] = cleaned_evals
+ records.append(r)
+
+ # Reorder the records, this is optional
+ for r in records:
+ if r['id'] <= 20:
+ r['id'] += 60
+ else:
+ r['id'] -= 20
+ for r in records:
+ if r['id'] <= 50:
+ r['id'] += 10
+ elif 50 < r['id'] <= 60:
+ r['id'] -= 50
+ for r in records:
+ if r['id'] == 7:
+ r['id'] = 1
+ elif r['id'] < 7:
+ r['id'] += 1
+
+ records.sort(key=lambda x: x['id'])
+
+ # Write to file
+ with open('webpage/data.json', 'w') as f:
+ json.dump({'questions': records, 'models': models}, f, indent=2)
diff --git a/llava/eval/m4c_evaluator.py b/llava/eval/m4c_evaluator.py
new file mode 100644
index 0000000000000000000000000000000000000000..e30e958da061a4f0a0bfe34b12d2fcaeba7ff2f4
--- /dev/null
+++ b/llava/eval/m4c_evaluator.py
@@ -0,0 +1,334 @@
+# Copyright (c) Facebook, Inc. and its affiliates.
+import re
+
+from tqdm import tqdm
+
+
+class EvalAIAnswerProcessor:
+ """
+ Processes an answer similar to Eval AI
+ copied from
+ https://github.com/facebookresearch/mmf/blob/c46b3b3391275b4181567db80943473a89ab98ab/pythia/tasks/processors.py#L897
+ """
+
+ CONTRACTIONS = {
+ "aint": "ain't",
+ "arent": "aren't",
+ "cant": "can't",
+ "couldve": "could've",
+ "couldnt": "couldn't",
+ "couldn'tve": "couldn't've",
+ "couldnt've": "couldn't've",
+ "didnt": "didn't",
+ "doesnt": "doesn't",
+ "dont": "don't",
+ "hadnt": "hadn't",
+ "hadnt've": "hadn't've",
+ "hadn'tve": "hadn't've",
+ "hasnt": "hasn't",
+ "havent": "haven't",
+ "hed": "he'd",
+ "hed've": "he'd've",
+ "he'dve": "he'd've",
+ "hes": "he's",
+ "howd": "how'd",
+ "howll": "how'll",
+ "hows": "how's",
+ "Id've": "I'd've",
+ "I'dve": "I'd've",
+ "Im": "I'm",
+ "Ive": "I've",
+ "isnt": "isn't",
+ "itd": "it'd",
+ "itd've": "it'd've",
+ "it'dve": "it'd've",
+ "itll": "it'll",
+ "let's": "let's",
+ "maam": "ma'am",
+ "mightnt": "mightn't",
+ "mightnt've": "mightn't've",
+ "mightn'tve": "mightn't've",
+ "mightve": "might've",
+ "mustnt": "mustn't",
+ "mustve": "must've",
+ "neednt": "needn't",
+ "notve": "not've",
+ "oclock": "o'clock",
+ "oughtnt": "oughtn't",
+ "ow's'at": "'ow's'at",
+ "'ows'at": "'ow's'at",
+ "'ow'sat": "'ow's'at",
+ "shant": "shan't",
+ "shed've": "she'd've",
+ "she'dve": "she'd've",
+ "she's": "she's",
+ "shouldve": "should've",
+ "shouldnt": "shouldn't",
+ "shouldnt've": "shouldn't've",
+ "shouldn'tve": "shouldn't've",
+ "somebody'd": "somebodyd",
+ "somebodyd've": "somebody'd've",
+ "somebody'dve": "somebody'd've",
+ "somebodyll": "somebody'll",
+ "somebodys": "somebody's",
+ "someoned": "someone'd",
+ "someoned've": "someone'd've",
+ "someone'dve": "someone'd've",
+ "someonell": "someone'll",
+ "someones": "someone's",
+ "somethingd": "something'd",
+ "somethingd've": "something'd've",
+ "something'dve": "something'd've",
+ "somethingll": "something'll",
+ "thats": "that's",
+ "thered": "there'd",
+ "thered've": "there'd've",
+ "there'dve": "there'd've",
+ "therere": "there're",
+ "theres": "there's",
+ "theyd": "they'd",
+ "theyd've": "they'd've",
+ "they'dve": "they'd've",
+ "theyll": "they'll",
+ "theyre": "they're",
+ "theyve": "they've",
+ "twas": "'twas",
+ "wasnt": "wasn't",
+ "wed've": "we'd've",
+ "we'dve": "we'd've",
+ "weve": "we've",
+ "werent": "weren't",
+ "whatll": "what'll",
+ "whatre": "what're",
+ "whats": "what's",
+ "whatve": "what've",
+ "whens": "when's",
+ "whered": "where'd",
+ "wheres": "where's",
+ "whereve": "where've",
+ "whod": "who'd",
+ "whod've": "who'd've",
+ "who'dve": "who'd've",
+ "wholl": "who'll",
+ "whos": "who's",
+ "whove": "who've",
+ "whyll": "why'll",
+ "whyre": "why're",
+ "whys": "why's",
+ "wont": "won't",
+ "wouldve": "would've",
+ "wouldnt": "wouldn't",
+ "wouldnt've": "wouldn't've",
+ "wouldn'tve": "wouldn't've",
+ "yall": "y'all",
+ "yall'll": "y'all'll",
+ "y'allll": "y'all'll",
+ "yall'd've": "y'all'd've",
+ "y'alld've": "y'all'd've",
+ "y'all'dve": "y'all'd've",
+ "youd": "you'd",
+ "youd've": "you'd've",
+ "you'dve": "you'd've",
+ "youll": "you'll",
+ "youre": "you're",
+ "youve": "you've",
+ }
+
+ NUMBER_MAP = {
+ "none": "0",
+ "zero": "0",
+ "one": "1",
+ "two": "2",
+ "three": "3",
+ "four": "4",
+ "five": "5",
+ "six": "6",
+ "seven": "7",
+ "eight": "8",
+ "nine": "9",
+ "ten": "10",
+ }
+ ARTICLES = ["a", "an", "the"]
+ PERIOD_STRIP = re.compile(r"(?!<=\d)(\.)(?!\d)")
+ COMMA_STRIP = re.compile(r"(?<=\d)(\,)+(?=\d)")
+ PUNCTUATIONS = [
+ ";",
+ r"/",
+ "[",
+ "]",
+ '"',
+ "{",
+ "}",
+ "(",
+ ")",
+ "=",
+ "+",
+ "\\",
+ "_",
+ "-",
+ ">",
+ "<",
+ "@",
+ "`",
+ ",",
+ "?",
+ "!",
+ ]
+
+ def __init__(self, *args, **kwargs):
+ pass
+
+ def word_tokenize(self, word):
+ word = word.lower()
+ word = word.replace(",", "").replace("?", "").replace("'s", " 's")
+ return word.strip()
+
+ def process_punctuation(self, in_text):
+ out_text = in_text
+ for p in self.PUNCTUATIONS:
+ if (p + " " in in_text or " " + p in in_text) or (
+ re.search(self.COMMA_STRIP, in_text) is not None
+ ):
+ out_text = out_text.replace(p, "")
+ else:
+ out_text = out_text.replace(p, " ")
+ out_text = self.PERIOD_STRIP.sub("", out_text, re.UNICODE)
+ return out_text
+
+ def process_digit_article(self, in_text):
+ out_text = []
+ temp_text = in_text.lower().split()
+ for word in temp_text:
+ word = self.NUMBER_MAP.setdefault(word, word)
+ if word not in self.ARTICLES:
+ out_text.append(word)
+ else:
+ pass
+ for word_id, word in enumerate(out_text):
+ if word in self.CONTRACTIONS:
+ out_text[word_id] = self.CONTRACTIONS[word]
+ out_text = " ".join(out_text)
+ return out_text
+
+ def __call__(self, item):
+ item = self.word_tokenize(item)
+ item = item.replace("\n", " ").replace("\t", " ").strip()
+ item = self.process_punctuation(item)
+ item = self.process_digit_article(item)
+ return item
+
+
+class TextVQAAccuracyEvaluator:
+ def __init__(self):
+ self.answer_processor = EvalAIAnswerProcessor()
+
+ def _compute_answer_scores(self, raw_answers):
+ """
+ compute the accuracy (soft score) of human answers
+ """
+ answers = [self.answer_processor(a) for a in raw_answers]
+ assert len(answers) == 10
+ gt_answers = list(enumerate(answers))
+ unique_answers = set(answers)
+ unique_answer_scores = {}
+
+ for unique_answer in unique_answers:
+ accs = []
+ for gt_answer in gt_answers:
+ other_answers = [item for item in gt_answers if item != gt_answer]
+ matching_answers = [
+ item for item in other_answers if item[1] == unique_answer
+ ]
+ acc = min(1, float(len(matching_answers)) / 3)
+ accs.append(acc)
+ unique_answer_scores[unique_answer] = sum(accs) / len(accs)
+
+ return unique_answer_scores
+
+ def eval_pred_list(self, pred_list):
+ pred_scores = []
+ for entry in tqdm(pred_list):
+ pred_answer = self.answer_processor(entry["pred_answer"])
+ unique_answer_scores = self._compute_answer_scores(entry["gt_answers"])
+ score = unique_answer_scores.get(pred_answer, 0.0)
+ pred_scores.append(score)
+
+ accuracy = sum(pred_scores) / len(pred_scores)
+ return accuracy
+
+
+class STVQAAccuracyEvaluator:
+ def __init__(self):
+ self.answer_processor = EvalAIAnswerProcessor()
+
+ def eval_pred_list(self, pred_list):
+ pred_scores = []
+ for entry in pred_list:
+ pred_answer = self.answer_processor(entry["pred_answer"])
+ gts = [self.answer_processor(a) for a in entry["gt_answers"]]
+ score = 1.0 if pred_answer in gts else 0.0
+ pred_scores.append(score)
+
+ accuracy = sum(pred_scores) / len(pred_scores)
+ return accuracy
+
+
+class STVQAANLSEvaluator:
+ def __init__(self):
+ import editdistance # install with `pip install editdistance`
+
+ self.get_edit_distance = editdistance.eval
+
+ def get_anls(self, s1, s2):
+ s1 = s1.lower().strip()
+ s2 = s2.lower().strip()
+ iou = 1 - self.get_edit_distance(s1, s2) / max(len(s1), len(s2))
+ anls = iou if iou >= 0.5 else 0.0
+ return anls
+
+ def eval_pred_list(self, pred_list):
+ pred_scores = []
+ for entry in pred_list:
+ anls = max(
+ self.get_anls(entry["pred_answer"], gt) for gt in entry["gt_answers"]
+ )
+ pred_scores.append(anls)
+
+ accuracy = sum(pred_scores) / len(pred_scores)
+ return accuracy
+
+
+class TextCapsBleu4Evaluator:
+ def __init__(self):
+ # The following script requires Java 1.8.0 and pycocotools installed.
+ # The pycocoevalcap can be installed with pip as
+ # pip install git+https://github.com/ronghanghu/coco-caption.git@python23
+ # Original pycocoevalcap code is at https://github.com/tylin/coco-caption
+ # but has no python3 support yet.
+ try:
+ from pycocoevalcap.bleu.bleu import Bleu
+ from pycocoevalcap.tokenizer.ptbtokenizer import PTBTokenizer
+ except ModuleNotFoundError:
+ print(
+ "Please install pycocoevalcap module using "
+ "pip install git+https://github.com/ronghanghu/coco-caption.git@python23" # noqa
+ )
+ raise
+
+ self.tokenizer = PTBTokenizer()
+ self.scorer = Bleu(4)
+
+ def eval_pred_list(self, pred_list):
+ # Create reference and hypotheses captions.
+ gts = {}
+ res = {}
+ for idx, entry in enumerate(pred_list):
+ gts[idx] = [{"caption": a} for a in entry["gt_answers"]]
+ res[idx] = [{"caption": entry["pred_answer"]}]
+
+ gts = self.tokenizer.tokenize(gts)
+ res = self.tokenizer.tokenize(res)
+ score, _ = self.scorer.compute_score(gts, res)
+
+ bleu4 = score[3] # score is (Bleu-1, Bleu-2, Bleu-3, Bleu-4)
+ return bleu4
diff --git a/llava/eval/model_qa.py b/llava/eval/model_qa.py
new file mode 100644
index 0000000000000000000000000000000000000000..2e254da152ac644ff54fb5fa57e625d9e6ba31d1
--- /dev/null
+++ b/llava/eval/model_qa.py
@@ -0,0 +1,64 @@
+import argparse
+from transformers import AutoTokenizer, AutoModelForCausalLM, StoppingCriteria
+import torch
+import os
+import json
+from tqdm import tqdm
+import shortuuid
+
+from llava.conversation import default_conversation
+from llava.utils import disable_torch_init
+
+
+@torch.inference_mode()
+def eval_model(model_name, questions_file, answers_file):
+ # Model
+ disable_torch_init()
+ model_name = os.path.expanduser(model_name)
+ tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
+ model = AutoModelForCausalLM.from_pretrained(model_name,
+ torch_dtype=torch.float16).cuda()
+
+
+ ques_file = open(os.path.expanduser(questions_file), "r")
+ ans_file = open(os.path.expanduser(answers_file), "w")
+ for i, line in enumerate(tqdm(ques_file)):
+ idx = json.loads(line)["question_id"]
+ qs = json.loads(line)["text"]
+ cat = json.loads(line)["category"]
+ conv = default_conversation.copy()
+ conv.append_message(conv.roles[0], qs)
+ prompt = conv.get_prompt()
+ inputs = tokenizer([prompt])
+ input_ids = torch.as_tensor(inputs.input_ids).cuda()
+ output_ids = model.generate(
+ input_ids,
+ do_sample=True,
+ use_cache=True,
+ temperature=0.7,
+ max_new_tokens=1024,)
+ outputs = tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0]
+ try:
+ index = outputs.index(conv.sep, len(prompt))
+ except ValueError:
+ outputs += conv.sep
+ index = outputs.index(conv.sep, len(prompt))
+
+ outputs = outputs[len(prompt) + len(conv.roles[1]) + 2:index].strip()
+ ans_id = shortuuid.uuid()
+ ans_file.write(json.dumps({"question_id": idx,
+ "text": outputs,
+ "answer_id": ans_id,
+ "model_id": model_name,
+ "metadata": {}}) + "\n")
+ ans_file.flush()
+ ans_file.close()
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--model-name", type=str, default="facebook/opt-350m")
+ parser.add_argument("--question-file", type=str, default="tables/question.jsonl")
+ parser.add_argument("--answers-file", type=str, default="answer.jsonl")
+ args = parser.parse_args()
+
+ eval_model(args.model_name, args.question_file, args.answers_file)
diff --git a/llava/eval/model_vqa.py b/llava/eval/model_vqa.py
new file mode 100644
index 0000000000000000000000000000000000000000..8715ee1ef1d4ba6f48953152a8ab5387372a0f62
--- /dev/null
+++ b/llava/eval/model_vqa.py
@@ -0,0 +1,112 @@
+import argparse
+import torch
+import os
+import json
+from tqdm import tqdm
+import shortuuid
+
+from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
+from llava.conversation import conv_templates, SeparatorStyle
+from llava.model.builder import load_pretrained_model
+from llava.utils import disable_torch_init
+from llava.mm_utils import tokenizer_image_token, process_images, get_model_name_from_path
+
+from PIL import Image
+import math
+
+def split_list(lst, n):
+ """Split a list into n (roughly) equal-sized chunks"""
+ chunk_size = math.ceil(len(lst) / n) # integer division
+ return [lst[i:i+chunk_size] for i in range(0, len(lst), chunk_size)]
+
+
+def get_chunk(lst, n, k):
+ chunks = split_list(lst, n)
+ return chunks[k]
+
+
+def eval_model(args):
+ # Model
+ disable_torch_init()
+ model_path = os.path.expanduser(args.model_path)
+ model_name = get_model_name_from_path(model_path)
+ tokenizer, model, image_processor, context_len = load_pretrained_model(model_path, args.model_base, model_name)
+
+ questions = [json.loads(q) for q in open(os.path.expanduser(args.question_file), "r")]
+ questions = get_chunk(questions, args.num_chunks, args.chunk_idx)
+ answers_file = os.path.expanduser(args.answers_file)
+ os.makedirs(os.path.dirname(answers_file), exist_ok=True)
+ ans_file = open(answers_file, "w")
+ for line in tqdm(questions):
+ idx = line["id"]
+ image_file = line["image"]
+ qs = line["text"]
+ if 'box' in line:
+ box=line["box"]
+ else:
+ box=""
+ cur_prompt = qs
+ if model.config.mm_use_im_start_end:
+ qs = DEFAULT_IM_START_TOKEN + DEFAULT_IMAGE_TOKEN + DEFAULT_IM_END_TOKEN + '\n' + qs
+ else:
+ qs = DEFAULT_IMAGE_TOKEN + '\n' + qs
+
+ conv = conv_templates[args.conv_mode].copy()
+ conv.append_message(conv.roles[0], qs)
+ conv.append_message(conv.roles[1], None)
+ prompt = conv.get_prompt()
+
+ input_ids = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).cuda()
+
+ image = Image.open(os.path.join(args.image_folder, image_file)).convert('RGB')
+ # print("DEBUG",model.config)
+ image_tensor, image_new_size = process_images([image], image_processor, model.config)
+ # image_tensor,image_new_size = process_images([image], image_processor, model.config)[0]
+
+
+ with torch.inference_mode():
+ output_ids = model.generate(
+ input_ids,
+ # images=image_tensor.unsqueeze(0).half().cuda(),
+ images=image_tensor.half().cuda(),
+ image_sizes=[image_new_size],
+ do_sample=True if args.temperature > 0 else False,
+ temperature=args.temperature,
+ top_p=args.top_p,
+ num_beams=args.num_beams,
+ # no_repeat_ngram_size=3,
+ max_new_tokens=16384,
+ use_cache=True)
+
+ outputs = tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
+
+ metadata = {k: v for k, v in line.items() if k not in ["id", "image", "text"]}
+
+ ans_id = shortuuid.uuid()
+ ans_file.write(json.dumps({"question_id": idx,
+ 'image': image_file,
+ "prompt": cur_prompt,
+ "text": outputs,
+ "answer_id": ans_id,
+ "model_id": model_name,
+ "box": box,
+ "metadata": metadata}) + "\n")
+ ans_file.flush()
+ ans_file.close()
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--model-path", type=str, default="/fs/ess/PAS1576/boyu_gou/train_vlm/ui_llava_fine_tune/checkpoints/ui-llava-ocr-text/merged-llava-v1.5-vicuna-7b-16k-pad-fusion-ocr-100k-text-1-200k-mobile-aug-1-200k")
+ parser.add_argument("--model-base", type=str, default=None)
+ parser.add_argument("--image-folder", type=str, default="/fs/ess/PAS1576/boyu_gou/Benchmark/screenspot_imgs_resized/")
+ parser.add_argument("--question-file", type=str, default="/fs/ess/PAS1576/boyu_gou/Benchmark/screenspot_web_text.jsonl")
+ parser.add_argument("--answers-file", type=str, default="/fs/ess/PAS1576/boyu_gou/Benchmark/answer_screenspot_web.jsonl")
+ parser.add_argument("--conv-mode", type=str, default="llava_v1")
+ parser.add_argument("--num-chunks", type=int, default=1)
+ parser.add_argument("--chunk-idx", type=int, default=0)
+ parser.add_argument("--temperature", type=float, default=0.2)
+ parser.add_argument("--top_p", type=float, default=None)
+ parser.add_argument("--num_beams", type=int, default=1)
+ args = parser.parse_args()
+
+ eval_model(args)
diff --git a/llava/eval/model_vqa_loader.py b/llava/eval/model_vqa_loader.py
new file mode 100644
index 0000000000000000000000000000000000000000..d435b7d835bdfb2934e32a93f1e8eaab39420ad9
--- /dev/null
+++ b/llava/eval/model_vqa_loader.py
@@ -0,0 +1,144 @@
+import argparse
+import torch
+import os
+import json
+from tqdm import tqdm
+import shortuuid
+
+from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
+from llava.conversation import conv_templates, SeparatorStyle
+from llava.model.builder import load_pretrained_model
+from llava.utils import disable_torch_init
+from llava.mm_utils import tokenizer_image_token, process_images, get_model_name_from_path
+from torch.utils.data import Dataset, DataLoader
+
+from PIL import Image
+import math
+
+
+def split_list(lst, n):
+ """Split a list into n (roughly) equal-sized chunks"""
+ chunk_size = math.ceil(len(lst) / n) # integer division
+ return [lst[i:i+chunk_size] for i in range(0, len(lst), chunk_size)]
+
+
+def get_chunk(lst, n, k):
+ chunks = split_list(lst, n)
+ return chunks[k]
+
+
+# Custom dataset class
+class CustomDataset(Dataset):
+ def __init__(self, questions, image_folder, tokenizer, image_processor, model_config):
+ self.questions = questions
+ self.image_folder = image_folder
+ self.tokenizer = tokenizer
+ self.image_processor = image_processor
+ self.model_config = model_config
+
+ def __getitem__(self, index):
+ line = self.questions[index]
+ image_file = line["image"]
+ qs = line["text"]
+ if self.model_config.mm_use_im_start_end:
+ qs = DEFAULT_IM_START_TOKEN + DEFAULT_IMAGE_TOKEN + DEFAULT_IM_END_TOKEN + '\n' + qs
+ else:
+ qs = DEFAULT_IMAGE_TOKEN + '\n' + qs
+
+ conv = conv_templates[args.conv_mode].copy()
+ conv.append_message(conv.roles[0], qs)
+ conv.append_message(conv.roles[1], None)
+ prompt = conv.get_prompt()
+
+ image = Image.open(os.path.join(self.image_folder, image_file)).convert('RGB')
+ image_tensor = process_images([image], self.image_processor, self.model_config)[0]
+
+ input_ids = tokenizer_image_token(prompt, self.tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt')
+
+ return input_ids, image_tensor, image.size
+
+ def __len__(self):
+ return len(self.questions)
+
+
+def collate_fn(batch):
+ input_ids, image_tensors, image_sizes = zip(*batch)
+ input_ids = torch.stack(input_ids, dim=0)
+ image_tensors = torch.stack(image_tensors, dim=0)
+ return input_ids, image_tensors, image_sizes
+
+
+# DataLoader
+def create_data_loader(questions, image_folder, tokenizer, image_processor, model_config, batch_size=1, num_workers=4):
+ assert batch_size == 1, "batch_size must be 1"
+ dataset = CustomDataset(questions, image_folder, tokenizer, image_processor, model_config)
+ data_loader = DataLoader(dataset, batch_size=batch_size, num_workers=num_workers, shuffle=False, collate_fn=collate_fn)
+ return data_loader
+
+
+def eval_model(args):
+ # Model
+ disable_torch_init()
+ model_path = os.path.expanduser(args.model_path)
+ model_name = get_model_name_from_path(model_path)
+ tokenizer, model, image_processor, context_len = load_pretrained_model(model_path, args.model_base, model_name)
+
+ questions = [json.loads(q) for q in open(os.path.expanduser(args.question_file), "r")]
+ questions = get_chunk(questions, args.num_chunks, args.chunk_idx)
+ answers_file = os.path.expanduser(args.answers_file)
+ os.makedirs(os.path.dirname(answers_file), exist_ok=True)
+ ans_file = open(answers_file, "w")
+
+ if 'plain' in model_name and 'finetune' not in model_name.lower() and 'mmtag' not in args.conv_mode:
+ args.conv_mode = args.conv_mode + '_mmtag'
+ print(f'It seems that this is a plain model, but it is not using a mmtag prompt, auto switching to {args.conv_mode}.')
+
+ data_loader = create_data_loader(questions, args.image_folder, tokenizer, image_processor, model.config)
+
+ for (input_ids, image_tensor, image_sizes), line in tqdm(zip(data_loader, questions), total=len(questions)):
+ idx = line["question_id"]
+ cur_prompt = line["text"]
+
+ input_ids = input_ids.to(device='cuda', non_blocking=True)
+
+ with torch.inference_mode():
+ output_ids = model.generate(
+ input_ids,
+ images=image_tensor.to(dtype=torch.float16, device='cuda', non_blocking=True),
+ image_sizes=image_sizes,
+ do_sample=True if args.temperature > 0 else False,
+ temperature=args.temperature,
+ top_p=args.top_p,
+ num_beams=args.num_beams,
+ max_new_tokens=args.max_new_tokens,
+ use_cache=True)
+
+ outputs = tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
+
+ ans_id = shortuuid.uuid()
+ ans_file.write(json.dumps({"question_id": idx,
+ "prompt": cur_prompt,
+ "text": outputs,
+ "answer_id": ans_id,
+ "model_id": model_name,
+ "metadata": {}}) + "\n")
+ # ans_file.flush()
+ ans_file.close()
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--model-path", type=str, default="facebook/opt-350m")
+ parser.add_argument("--model-base", type=str, default=None)
+ parser.add_argument("--image-folder", type=str, default="")
+ parser.add_argument("--question-file", type=str, default="tables/question.jsonl")
+ parser.add_argument("--answers-file", type=str, default="answer.jsonl")
+ parser.add_argument("--conv-mode", type=str, default="llava_v1")
+ parser.add_argument("--num-chunks", type=int, default=1)
+ parser.add_argument("--chunk-idx", type=int, default=0)
+ parser.add_argument("--temperature", type=float, default=0.2)
+ parser.add_argument("--top_p", type=float, default=None)
+ parser.add_argument("--num_beams", type=int, default=1)
+ parser.add_argument("--max_new_tokens", type=int, default=128)
+ args = parser.parse_args()
+
+ eval_model(args)
diff --git a/llava/eval/model_vqa_mmbench.py b/llava/eval/model_vqa_mmbench.py
new file mode 100644
index 0000000000000000000000000000000000000000..bd7a4c8085ddb7b237b17b054e5eaa0569018178
--- /dev/null
+++ b/llava/eval/model_vqa_mmbench.py
@@ -0,0 +1,160 @@
+import argparse
+import torch
+import os
+import json
+import pandas as pd
+from tqdm import tqdm
+import shortuuid
+
+from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
+from llava.conversation import conv_templates, SeparatorStyle
+from llava.model.builder import load_pretrained_model
+from llava.utils import disable_torch_init
+from llava.mm_utils import tokenizer_image_token, process_images, load_image_from_base64, get_model_name_from_path
+
+from PIL import Image
+import math
+
+
+all_options = ['A', 'B', 'C', 'D']
+
+
+def split_list(lst, n):
+ """Split a list into n (roughly) equal-sized chunks"""
+ chunk_size = math.ceil(len(lst) / n) # integer division
+ return [lst[i:i+chunk_size] for i in range(0, len(lst), chunk_size)]
+
+
+def get_chunk(lst, n, k):
+ chunks = split_list(lst, n)
+ return chunks[k]
+
+
+def is_none(value):
+ if value is None:
+ return True
+ if type(value) is float and math.isnan(value):
+ return True
+ if type(value) is str and value.lower() == 'nan':
+ return True
+ if type(value) is str and value.lower() == 'none':
+ return True
+ return False
+
+def get_options(row, options):
+ parsed_options = []
+ for option in options:
+ option_value = row[option]
+ if is_none(option_value):
+ break
+ parsed_options.append(option_value)
+ return parsed_options
+
+
+def eval_model(args):
+ # Model
+ disable_torch_init()
+ model_path = os.path.expanduser(args.model_path)
+ model_name = get_model_name_from_path(model_path)
+ tokenizer, model, image_processor, context_len = load_pretrained_model(model_path, args.model_base, model_name)
+
+ questions = pd.read_table(os.path.expanduser(args.question_file))
+ questions = get_chunk(questions, args.num_chunks, args.chunk_idx)
+ answers_file = os.path.expanduser(args.answers_file)
+ os.makedirs(os.path.dirname(answers_file), exist_ok=True)
+ ans_file = open(answers_file, "w")
+
+ if 'plain' in model_name and 'finetune' not in model_name.lower() and 'mmtag' not in args.conv_mode:
+ args.conv_mode = args.conv_mode + '_mmtag'
+ print(f'It seems that this is a plain model, but it is not using a mmtag prompt, auto switching to {args.conv_mode}.')
+
+ for index, row in tqdm(questions.iterrows(), total=len(questions)):
+ options = get_options(row, all_options)
+ cur_option_char = all_options[:len(options)]
+
+ if args.all_rounds:
+ num_rounds = len(options)
+ else:
+ num_rounds = 1
+
+ for round_idx in range(num_rounds):
+ idx = row['index']
+ question = row['question']
+ hint = row['hint']
+ image = load_image_from_base64(row['image'])
+ if not is_none(hint):
+ question = hint + '\n' + question
+ for option_char, option in zip(all_options[:len(options)], options):
+ question = question + '\n' + option_char + '. ' + option
+ qs = cur_prompt = question
+ if model.config.mm_use_im_start_end:
+ qs = DEFAULT_IM_START_TOKEN + DEFAULT_IMAGE_TOKEN + DEFAULT_IM_END_TOKEN + '\n' + qs
+ else:
+ qs = DEFAULT_IMAGE_TOKEN + '\n' + qs
+
+ if args.single_pred_prompt:
+ if args.lang == 'cn':
+ qs = qs + '\n' + "请直接回答选项字母。"
+ else:
+ qs = qs + '\n' + "Answer with the option's letter from the given choices directly."
+
+ conv = conv_templates[args.conv_mode].copy()
+ conv.append_message(conv.roles[0], qs)
+ conv.append_message(conv.roles[1], None)
+ prompt = conv.get_prompt()
+
+ input_ids = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).cuda()
+
+ image_tensor = process_images([image], image_processor, model.config)[0]
+
+ with torch.inference_mode():
+ output_ids = model.generate(
+ input_ids,
+ images=image_tensor.unsqueeze(0).half().cuda(),
+ image_sizes=[image.size],
+ do_sample=True if args.temperature > 0 else False,
+ temperature=args.temperature,
+ top_p=args.top_p,
+ num_beams=args.num_beams,
+ # no_repeat_ngram_size=3,
+ max_new_tokens=1024,
+ use_cache=True)
+
+ outputs = tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
+
+ ans_id = shortuuid.uuid()
+ ans_file.write(json.dumps({"question_id": idx,
+ "round_id": round_idx,
+ "prompt": cur_prompt,
+ "text": outputs,
+ "options": options,
+ "option_char": cur_option_char,
+ "answer_id": ans_id,
+ "model_id": model_name,
+ "metadata": {}}) + "\n")
+ ans_file.flush()
+
+ # rotate options
+ options = options[1:] + options[:1]
+ cur_option_char = cur_option_char[1:] + cur_option_char[:1]
+ ans_file.close()
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--model-path", type=str, default="facebook/opt-350m")
+ parser.add_argument("--model-base", type=str, default=None)
+ parser.add_argument("--image-folder", type=str, default="")
+ parser.add_argument("--question-file", type=str, default="tables/question.jsonl")
+ parser.add_argument("--answers-file", type=str, default="answer.jsonl")
+ parser.add_argument("--conv-mode", type=str, default="llava_v1")
+ parser.add_argument("--num-chunks", type=int, default=1)
+ parser.add_argument("--chunk-idx", type=int, default=0)
+ parser.add_argument("--temperature", type=float, default=0.2)
+ parser.add_argument("--top_p", type=float, default=None)
+ parser.add_argument("--num_beams", type=int, default=1)
+ parser.add_argument("--all-rounds", action="store_true")
+ parser.add_argument("--single-pred-prompt", action="store_true")
+ parser.add_argument("--lang", type=str, default="en")
+ args = parser.parse_args()
+
+ eval_model(args)
diff --git a/llava/eval/model_vqa_science.py b/llava/eval/model_vqa_science.py
new file mode 100644
index 0000000000000000000000000000000000000000..90fc681a20ee72131862772107f6be572f010c99
--- /dev/null
+++ b/llava/eval/model_vqa_science.py
@@ -0,0 +1,111 @@
+import argparse
+import torch
+import os
+import json
+from tqdm import tqdm
+import shortuuid
+
+from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
+from llava.conversation import conv_templates, SeparatorStyle
+from llava.model.builder import load_pretrained_model
+from llava.utils import disable_torch_init
+from llava.mm_utils import tokenizer_image_token, process_images, get_model_name_from_path
+
+from PIL import Image
+import math
+
+
+def split_list(lst, n):
+ """Split a list into n (roughly) equal-sized chunks"""
+ chunk_size = math.ceil(len(lst) / n) # integer division
+ return [lst[i:i+chunk_size] for i in range(0, len(lst), chunk_size)]
+
+
+def get_chunk(lst, n, k):
+ chunks = split_list(lst, n)
+ return chunks[k]
+
+
+def eval_model(args):
+ # Model
+ disable_torch_init()
+ model_path = os.path.expanduser(args.model_path)
+ model_name = get_model_name_from_path(model_path)
+ tokenizer, model, image_processor, context_len = load_pretrained_model(model_path, args.model_base, model_name)
+
+ questions = json.load(open(os.path.expanduser(args.question_file), "r"))
+ questions = get_chunk(questions, args.num_chunks, args.chunk_idx)
+ answers_file = os.path.expanduser(args.answers_file)
+ os.makedirs(os.path.dirname(answers_file), exist_ok=True)
+ ans_file = open(answers_file, "w")
+ for i, line in enumerate(tqdm(questions)):
+ idx = line["id"]
+ question = line['conversations'][0]
+ qs = question['value'].replace('', '').strip()
+ cur_prompt = qs
+
+ if 'image' in line:
+ image_file = line["image"]
+ image = Image.open(os.path.join(args.image_folder, image_file))
+ image_tensor = process_images([image], image_processor, model.config)[0]
+ images = image_tensor.unsqueeze(0).half().cuda()
+ image_sizes = [image.size]
+ if getattr(model.config, 'mm_use_im_start_end', False):
+ qs = DEFAULT_IM_START_TOKEN + DEFAULT_IMAGE_TOKEN + DEFAULT_IM_END_TOKEN + '\n' + qs
+ else:
+ qs = DEFAULT_IMAGE_TOKEN + '\n' + qs
+ cur_prompt = '' + '\n' + cur_prompt
+ else:
+ images = None
+ image_sizes = None
+
+ if args.single_pred_prompt:
+ qs = qs + '\n' + "Answer with the option's letter from the given choices directly."
+ cur_prompt = cur_prompt + '\n' + "Answer with the option's letter from the given choices directly."
+
+ conv = conv_templates[args.conv_mode].copy()
+ conv.append_message(conv.roles[0], qs)
+ conv.append_message(conv.roles[1], None)
+ prompt = conv.get_prompt()
+
+ input_ids = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).cuda()
+
+ with torch.inference_mode():
+ output_ids = model.generate(
+ input_ids,
+ images=images,
+ image_sizes=image_sizes,
+ do_sample=True if args.temperature > 0 else False,
+ temperature=args.temperature,
+ max_new_tokens=1024,
+ use_cache=True,
+ )
+
+ outputs = tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
+
+ ans_id = shortuuid.uuid()
+ ans_file.write(json.dumps({"question_id": idx,
+ "prompt": cur_prompt,
+ "text": outputs,
+ "answer_id": ans_id,
+ "model_id": model_name,
+ "metadata": {}}) + "\n")
+ ans_file.flush()
+ ans_file.close()
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--model-path", type=str, default="facebook/opt-350m")
+ parser.add_argument("--model-base", type=str, default=None)
+ parser.add_argument("--image-folder", type=str, default="")
+ parser.add_argument("--question-file", type=str, default="tables/question.json")
+ parser.add_argument("--answers-file", type=str, default="answer.jsonl")
+ parser.add_argument("--conv-mode", type=str, default="llava_v0")
+ parser.add_argument("--num-chunks", type=int, default=1)
+ parser.add_argument("--chunk-idx", type=int, default=0)
+ parser.add_argument("--temperature", type=float, default=0.2)
+ parser.add_argument("--answer-prompter", action="store_true")
+ parser.add_argument("--single-pred-prompt", action="store_true")
+ args = parser.parse_args()
+
+ eval_model(args)
diff --git a/llava/eval/qa_baseline_gpt35.py b/llava/eval/qa_baseline_gpt35.py
new file mode 100644
index 0000000000000000000000000000000000000000..babab6e12b4bb8cfa74a7edfa5e56cd1b3e2bf6c
--- /dev/null
+++ b/llava/eval/qa_baseline_gpt35.py
@@ -0,0 +1,74 @@
+"""Generate answers with GPT-3.5"""
+# Note: you need to be using OpenAI Python v0.27.0 for the code below to work
+import argparse
+import json
+import os
+import time
+import concurrent.futures
+
+import openai
+import tqdm
+import shortuuid
+
+MODEL = 'gpt-3.5-turbo'
+MODEL_ID = 'gpt-3.5-turbo:20230327'
+
+def get_answer(question_id: int, question: str, max_tokens: int):
+ ans = {
+ 'answer_id': shortuuid.uuid(),
+ 'question_id': question_id,
+ 'model_id': MODEL_ID,
+ }
+ for _ in range(3):
+ try:
+ response = openai.ChatCompletion.create(
+ model=MODEL,
+ messages=[{
+ 'role': 'system',
+ 'content': 'You are a helpful assistant.'
+ }, {
+ 'role': 'user',
+ 'content': question,
+ }],
+ max_tokens=max_tokens,
+ )
+ ans['text'] = response['choices'][0]['message']['content']
+ return ans
+ except Exception as e:
+ print('[ERROR]', e)
+ ans['text'] = '#ERROR#'
+ time.sleep(1)
+ return ans
+
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(description='ChatGPT answer generation.')
+ parser.add_argument('-q', '--question')
+ parser.add_argument('-o', '--output')
+ parser.add_argument('--max-tokens', type=int, default=1024, help='maximum number of tokens produced in the output')
+ args = parser.parse_args()
+
+ questions_dict = {}
+ with open(os.path.expanduser(args.question)) as f:
+ for line in f:
+ if not line:
+ continue
+ q = json.loads(line)
+ questions_dict[q['question_id']] = q['text']
+
+ answers = []
+
+ with concurrent.futures.ThreadPoolExecutor(max_workers=32) as executor:
+ futures = []
+ for qid, question in questions_dict.items():
+ future = executor.submit(get_answer, qid, question, args.max_tokens)
+ futures.append(future)
+
+ for future in tqdm.tqdm(concurrent.futures.as_completed(futures), total=len(futures)):
+ answers.append(future.result())
+
+ answers.sort(key=lambda x: x['question_id'])
+
+ with open(os.path.expanduser(args.output), 'w') as f:
+ table = [json.dumps(ans) for ans in answers]
+ f.write('\n'.join(table))
diff --git a/llava/eval/run_llava.py b/llava/eval/run_llava.py
new file mode 100644
index 0000000000000000000000000000000000000000..24b0fffcc11a2045dfc7f5ac6cae4f057aaba6d6
--- /dev/null
+++ b/llava/eval/run_llava.py
@@ -0,0 +1,145 @@
+import argparse
+import torch
+
+from llava.constants import (
+ IMAGE_TOKEN_INDEX,
+ DEFAULT_IMAGE_TOKEN,
+ DEFAULT_IM_START_TOKEN,
+ DEFAULT_IM_END_TOKEN,
+ IMAGE_PLACEHOLDER,
+)
+from llava.conversation import conv_templates, SeparatorStyle
+from llava.model.builder import load_pretrained_model
+from llava.utils import disable_torch_init
+from llava.mm_utils import (
+ process_images,
+ tokenizer_image_token,
+ get_model_name_from_path,
+)
+
+from PIL import Image
+
+import requests
+from PIL import Image
+from io import BytesIO
+import re
+
+
+def image_parser(args):
+ out = args.image_file.split(args.sep)
+ return out
+
+
+def load_image(image_file):
+ if image_file.startswith("http") or image_file.startswith("https"):
+ response = requests.get(image_file)
+ image = Image.open(BytesIO(response.content)).convert("RGB")
+ else:
+ image = Image.open(image_file).convert("RGB")
+ return image
+
+
+def load_images(image_files):
+ out = []
+ for image_file in image_files:
+ image = load_image(image_file)
+ out.append(image)
+ return out
+
+
+def eval_model(args):
+ # Model
+ disable_torch_init()
+
+ model_name = get_model_name_from_path(args.model_path)
+ tokenizer, model, image_processor, context_len = load_pretrained_model(
+ args.model_path, args.model_base, model_name
+ )
+
+ qs = args.query
+ image_token_se = DEFAULT_IM_START_TOKEN + DEFAULT_IMAGE_TOKEN + DEFAULT_IM_END_TOKEN
+ if IMAGE_PLACEHOLDER in qs:
+ if model.config.mm_use_im_start_end:
+ qs = re.sub(IMAGE_PLACEHOLDER, image_token_se, qs)
+ else:
+ qs = re.sub(IMAGE_PLACEHOLDER, DEFAULT_IMAGE_TOKEN, qs)
+ else:
+ if model.config.mm_use_im_start_end:
+ qs = image_token_se + "\n" + qs
+ else:
+ qs = DEFAULT_IMAGE_TOKEN + "\n" + qs
+
+ if "llama-2" in model_name.lower():
+ conv_mode = "llava_llama_2"
+ elif "mistral" in model_name.lower():
+ conv_mode = "mistral_instruct"
+ elif "v1.6-34b" in model_name.lower():
+ conv_mode = "chatml_direct"
+ elif "v1" in model_name.lower():
+ conv_mode = "llava_v1"
+ elif "mpt" in model_name.lower():
+ conv_mode = "mpt"
+ else:
+ conv_mode = "llava_v0"
+
+ if args.conv_mode is not None and conv_mode != args.conv_mode:
+ print(
+ "[WARNING] the auto inferred conversation mode is {}, while `--conv-mode` is {}, using {}".format(
+ conv_mode, args.conv_mode, args.conv_mode
+ )
+ )
+ else:
+ args.conv_mode = conv_mode
+
+ conv = conv_templates[args.conv_mode].copy()
+ conv.append_message(conv.roles[0], qs)
+ conv.append_message(conv.roles[1], None)
+ prompt = conv.get_prompt()
+
+ image_files = image_parser(args)
+ images = load_images(image_files)
+ image_sizes = [x.size for x in images]
+ images_tensor = process_images(
+ images,
+ image_processor,
+ model.config
+ ).to(model.device, dtype=torch.float16)
+
+ input_ids = (
+ tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors="pt")
+ .unsqueeze(0)
+ .cuda()
+ )
+
+ with torch.inference_mode():
+ output_ids = model.generate(
+ input_ids,
+ images=images_tensor,
+ image_sizes=image_sizes,
+ do_sample=True if args.temperature > 0 else False,
+ temperature=args.temperature,
+ top_p=args.top_p,
+ num_beams=args.num_beams,
+ max_new_tokens=args.max_new_tokens,
+ use_cache=True,
+ )
+
+ outputs = tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
+ print(outputs)
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--model-path", type=str, default="facebook/opt-350m")
+ parser.add_argument("--model-base", type=str, default=None)
+ parser.add_argument("--image-file", type=str, required=True)
+ parser.add_argument("--query", type=str, required=True)
+ parser.add_argument("--conv-mode", type=str, default=None)
+ parser.add_argument("--sep", type=str, default=",")
+ parser.add_argument("--temperature", type=float, default=0.2)
+ parser.add_argument("--top_p", type=float, default=None)
+ parser.add_argument("--num_beams", type=int, default=1)
+ parser.add_argument("--max_new_tokens", type=int, default=512)
+ args = parser.parse_args()
+
+ eval_model(args)
diff --git a/llava/eval/seeact/__init__.py b/llava/eval/seeact/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..f777aa2b723674ec858f8532ca4f9a779fafa6fe
--- /dev/null
+++ b/llava/eval/seeact/__init__.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2024 OSU Natural Language Processing Group
+#
+# Licensed under the OpenRAIL-S License;
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.licenses.ai/ai-pubs-open-rails-vz1
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
\ No newline at end of file
diff --git a/llava/eval/seeact/agent.py b/llava/eval/seeact/agent.py
new file mode 100644
index 0000000000000000000000000000000000000000..4e0b30c2ff51a3ddd2d5025db1380413a4b54e38
--- /dev/null
+++ b/llava/eval/seeact/agent.py
@@ -0,0 +1,945 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2024 OSU Natural Language Processing Group
+#
+# Licensed under the OpenRAIL-S License;
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.licenses.ai/ai-pubs-open-rails-vz1
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import logging
+import os
+import traceback
+from datetime import datetime
+import json
+import toml
+import torch
+from playwright.async_api import async_playwright,Locator
+
+from .data_utils.format_prompt_utils import get_index_from_option_name, generate_new_query_prompt, \
+ generate_new_referring_prompt, format_options
+from .demo_utils.browser_helper import normal_launch_async, normal_new_context_async, \
+ get_interactive_elements_with_playwright, select_option, saveconfig, get_select_elements_with_playwright
+from .demo_utils.format_prompt import format_choices, postprocess_action_lmm
+from .demo_utils.inference_engine import engine_factory
+
+
+
+from llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
+from llava.conversation import conv_templates
+from llava.model.builder import load_pretrained_model
+from llava.utils import disable_torch_init
+from llava.mm_utils import tokenizer_image_token, process_images, get_model_name_from_path
+
+from PIL import Image, ImageDraw,ImageFont
+
+import numpy as np
+
+import asyncio
+
+
+def average_color(image, bbox):
+ """计算指定区域的平均颜色。"""
+ region = image.crop(bbox)
+ numpy_image = np.array(region)
+ avg_color = np.mean(numpy_image, axis=(0, 1))
+ return tuple(avg_color)
+
+
+def color_contrast(color1, color2):
+ """计算两种颜色之间的对比度。"""
+ l1 = 0.2126 * pow(color1[0]/255, 2.2) + \
+ 0.7152 * pow(color1[1]/255, 2.2) + \
+ 0.0722 * pow(color1[2]/255, 2.2)
+ l2 = 0.2126 * pow(color2[0]/255, 2.2) + \
+ 0.7152 * pow(color2[1]/255, 2.2) + \
+ 0.0722 * pow(color2[2]/255, 2.2)
+ if l1 > l2:
+ return (l1 + 0.05) / (l2 + 0.05)
+ else:
+ return (l2 + 0.05) / (l1 + 0.05)
+
+def text_color_for_background(background_color):
+ """选择最佳的文本颜色基于背景颜色。"""
+ red = (255, 0, 0)
+ blue = (0, 0, 255)
+ contrast_red = color_contrast(background_color, red)
+ contrast_blue = color_contrast(background_color, blue)
+ if contrast_red > contrast_blue:
+ return red
+ else:
+ return blue
+
+
+def draw_text(draw, text, position, font, max_width, image):
+ """在图像上绘制自动换行的文本,并根据背景色调整文本颜色。"""
+ x, y = position
+ words = text.split()
+ current_line = ""
+
+ # 使用一个空字符串来获取单行文字的高度
+ line_height = 40
+
+ for word in words:
+ test_line = f"{current_line} {word}".strip()
+ width, _ = 40,40 # 正确调用font对象的getsize方法
+ if width <= max_width:
+ current_line = test_line
+ else:
+ bbox = (x, y, x + width, y + line_height)
+ bg_color = average_color(image, bbox)
+ color = text_color_for_background(bg_color)
+ draw.text((x, y), current_line, font=font, fill=color)
+ y += line_height
+ current_line = word
+ if current_line:
+ bbox = (x, y, x + width, y + line_height)
+ bg_color = average_color(image, bbox)
+ color = text_color_for_background(bg_color)
+ draw.text((x, y), current_line, font=font, fill=color)
+
+
+class SeeActAgent:
+ def __init__(self,
+ config_path=None,
+ save_file_dir="seeact_agent_files",
+ save_task_id=None,
+ default_task='Search for the flight status for the flight AA 3942 leaving on Jun. 10"',
+ default_website="https://www.aa.com/homePage.do",
+ input_info=["screenshot"],
+ grounding_strategy="text_choice",
+ max_auto_op=50,
+ max_continuous_no_op=5,
+ highlight=False,
+ headless=False,
+ args=[],
+ browser_app="chrome",
+ persistant=False,
+ persistant_user_path="",
+ save_video=False,
+ viewport={
+ "width": 1280,
+ "height": 960
+ },
+ tracing=False,
+ trace={
+ "screenshots": True,
+ "snapshots": True,
+ "sources": True
+ },
+ rate_limit=-1,
+ model="gpt-4-turbo",
+ temperature=0.9
+
+ ):
+
+ try:
+ if config_path is not None:
+ with open(config_path,
+ 'r') as config:
+ print(f"Configuration File Loaded - {config_path}")
+ config = toml.load(config)
+ else:
+ config = {
+ "basic": {
+ "save_file_dir": save_file_dir,
+ "default_task": default_task,
+ "default_website": default_website
+ },
+ "agent": {
+ "input_info": input_info,
+ "grounding_strategy": grounding_strategy,
+ "max_auto_op": max_auto_op,
+ "max_continuous_no_op": max_continuous_no_op,
+ "highlight": highlight
+ },
+ "openai": {
+ "rate_limit": rate_limit,
+ "model": model,
+ "temperature": temperature
+ }
+ }
+ config.update({
+ "browser": {
+ "headless": headless,
+ "args": args,
+ "browser_app": browser_app,
+ "persistant": persistant,
+ "persistant_user_path": persistant_user_path,
+ "save_video": save_video,
+ "viewport": viewport,
+ "tracing": tracing,
+ "trace": trace
+ }
+ })
+
+ except FileNotFoundError:
+ print(f"Error: File '{os.path.abspath(config_path)}' not found.")
+ except toml.TomlDecodeError:
+ print(f"Error: File '{os.path.abspath(config_path)}' is not a valid TOML file.")
+
+ self.config = config
+ self.complete_flag = False
+ self.session_control = {
+ 'active_page': None,
+ 'context': None,
+ 'browser': None
+ }
+ self.tasks = [self.config["basic"]["default_task"]]
+ if save_task_id:
+ self.main_path = os.path.join(self.config["basic"]["save_file_dir"],
+ save_task_id)
+
+
+ else:
+ self.main_path = os.path.join(self.config["basic"]["save_file_dir"], datetime.now().strftime("%Y%m%d_%H%M%S"))
+ if os.path.exists(self.main_path):
+ self.complete_flag=True
+
+ os.makedirs(self.main_path, exist_ok=True)
+ self.action_space = ["CLICK", "PRESS ENTER", "HOVER", "SCROLL UP", "SCROLL DOWN", "NEW TAB", "CLOSE TAB",
+ "GO BACK", "GO FORWARD",
+ "TERMINATE", "SELECT", "TYPE", "GOTO", "MEMORIZE"] # Define the list of actions here
+
+ self.no_value_op = ["CLICK", "PRESS ENTER", "HOVER", "SCROLL UP", "SCROLL DOWN", "NEW TAB", "CLOSE TAB",
+ "PRESS HOME", "PRESS END", "PRESS PAGEUP", "PRESS PAGEDOWN"
+ "GO BACK",
+ "GO FORWARD",
+ "TERMINATE", "NONE"]
+
+ self.with_value_op = ["SELECT", "TYPE", "GOTO", "MEMORIZE", "SAY"]
+
+ self.no_element_op = ["PRESS ENTER", "SCROLL UP", "SCROLL DOWN", "NEW TAB", "CLOSE TAB", "GO BACK", "GOTO",
+ "PRESS HOME", "PRESS END", "PRESS PAGEUP", "PRESS PAGEDOWN",
+ "GO FORWARD",
+ "TERMINATE", "NONE", "MEMORIZE", "SAY"]
+
+ # Initialize the primary logger and the developer logger
+ self.logger = self._setup_logger(redirect_to_dev_log=False)
+ # self.dev_logger = self._setup_dev_logger()
+
+ # # Redirect primary logger messages to dev_logger as well
+ # for handler in self.logger.handlers:
+ # self.dev_logger.addHandler(handler)
+
+ self.engine = engine_factory(**self.config['openai'])
+ self.taken_actions = []
+ self.prompts = self._initialize_prompts()
+ self.time_step = 0
+ self.valid_op = 0
+ # self.error=0
+ self.continuous_no_op = 0
+ self.predictions=[]
+
+ disable_torch_init()
+ self.pixui_model_path = os.path.expanduser(
+ "/fs/ess/PAS1576/boyu_gou/train_vlm/ui_llava_fine_tune/checkpoints/only-web/merged-llava-v1.5-vicuna-7b-16k-pad-no-fusion-web-80k")
+ self.pixui_model_name = get_model_name_from_path(self.pixui_model_path)
+ self.pixui_tokenizer, self.pixui_model, self.pixui_image_processor, self.pixui_context_len = load_pretrained_model(self.pixui_model_path, None, self.pixui_model_name)
+
+ def _initialize_prompts(self):
+ """Initialize prompt information including dynamic action space."""
+ action_format = f"" # Dynamically generate action_format based on self.action_space
+
+ return {
+ "system_prompt": '''You are assisting humans doing web navigation tasks step by step. At each stage, you can see the webpage by a screenshot and know the previous actions before the current step decided by yourself that have been executed for this task through recorded history. You need to decide on the first following action to take.''',
+
+ "action_space": '''
+Here are the descriptions of all allowed actions:
+
+No Value Operations:
+- CLICK: Click on a webpage element using the mouse.
+- PRESS ENTER: Press the Enter key, typically to submit a form or confirm an input.
+- SCROLL UP: Scroll the webpage upwards by half of the window height.
+- SCROLL DOWN: Scroll the webpage downwards by half of the window height.
+- PRESS HOME: Scroll to the top of the webpage.
+- PRESS END: Scroll to the bottom of the webpage.
+- PRESS PAGEUP: Scroll up by one window height.
+- PRESS PAGEDOWN: Scroll down by one window height.
+- GO BACK: Navigate to the previous page in the browser history.
+- GO FORWARD: Navigate to the next page in the browser history.
+- TERMINATE: End the current task, typically used when the task is considered complete or requires potentially harmful actions.
+- NONE: Indicates that no action is necessary at this stage. Used to skip an action or wait.
+
+With Value Operations:
+- SELECT: Choose an option from a dropdown menu or