Tools from Spaces: Fix bug preventing use of long prompts. (#134)
This commit is contained in:
parent
14134c23e9
commit
320dd77f37
|
@ -620,9 +620,12 @@ class Tool:
|
||||||
arg.save(temp_file.name)
|
arg.save(temp_file.name)
|
||||||
arg = temp_file.name
|
arg = temp_file.name
|
||||||
if (
|
if (
|
||||||
isinstance(arg, (str, Path))
|
isinstance(arg, str)
|
||||||
and Path(arg).exists()
|
and os.path.isfile(arg)
|
||||||
and Path(arg).is_file()
|
) or (
|
||||||
|
isinstance(arg, Path)
|
||||||
|
and arg.exists()
|
||||||
|
and arg.is_file()
|
||||||
) or is_http_url_like(arg):
|
) or is_http_url_like(arg):
|
||||||
arg = handle_file(arg)
|
arg = handle_file(arg)
|
||||||
return arg
|
return arg
|
||||||
|
|
Loading…
Reference in New Issue