Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fixed improper kwargs

Dillon DuPontd172ca85639f
diff --git a/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py b/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py
index 11f03c0f7b..46d72db33b 100644
--- a/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py
+++ b/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py
@@ -1,4 +1,5 @@
import asyncio
+import functools
import warnings
from concurrent.futures import ThreadPoolExecutor
from typing import Iterator, AsyncIterator, Dict, List, Any, Optional
@@ -189,7 +190,10 @@ class HuggingFaceLocalAdapter(CustomLLM):
"""
# Run _generate in thread pool to avoid blocking
loop = asyncio.get_event_loop()
- generated_text = await loop.run_in_executor(self._executor, self._generate, **kwargs)
+ generated_text = await loop.run_in_executor(
+ self._executor,
+ functools.partial(self._generate, **kwargs)
+ )
return await acompletion(
model=f"huggingface-local/{kwargs['model']}",
@@ -223,7 +227,10 @@ class HuggingFaceLocalAdapter(CustomLLM):
"""
# Run _generate in thread pool to avoid blocking
loop = asyncio.get_event_loop()
- generated_text = await loop.run_in_executor(self._executor, self._generate, **kwargs)
+ generated_text = await loop.run_in_executor(
+ self._executor,
+ functools.partial(self._generate, **kwargs)
+ )
generic_streaming_chunk: GenericStreamingChunk = {
"finish_reason": "stop",