Tools from Spaces: Fix bug preventing use of long prompts. (#134)

This commit is contained in:
Jack Kingston 2025-01-12 14:12:53 +00:00 committed by GitHub
parent 14134c23e9
commit 320dd77f37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 3 deletions

View File

@ -620,9 +620,12 @@ class Tool:
arg.save(temp_file.name)
arg = temp_file.name
if (
isinstance(arg, (str, Path))
and Path(arg).exists()
and Path(arg).is_file()
isinstance(arg, str)
and os.path.isfile(arg)
) or (
isinstance(arg, Path)
and arg.exists()
and arg.is_file()
) or is_http_url_like(arg):
arg = handle_file(arg)
return arg