docs: small fixes in docs (#245)

This commit is contained in:
Moritz Laurer 2025-01-17 19:20:25 +01:00 committed by GitHub
parent d1b8a78783
commit 7d6599e430
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 15 deletions

View File

@ -337,7 +337,7 @@ from smolagents import (
) )
# Import tool from Hub # Import tool from Hub
image_generation_tool = load_tool("m-ric/text-to-image") image_generation_tool = load_tool("m-ric/text-to-image", trust_remote_code=True)
model = HfApiModel(model_id) model = HfApiModel(model_id)

View File

@ -553,21 +553,21 @@ class Tool:
The Space, as a tool. The Space, as a tool.
Examples: Examples:
```py
>>> image_generator = Tool.from_space(
... space_id="black-forest-labs/FLUX.1-schnell",
... name="image-generator",
... description="Generate an image from a prompt"
... )
>>> image = image_generator("Generate an image of a cool surfer in Tahiti")
``` ```
image_generator = Tool.from_space( ```py
space_id="black-forest-labs/FLUX.1-schnell", >>> face_swapper = Tool.from_space(
name="image-generator", ... "tuan2308/face-swap",
description="Generate an image from a prompt" ... "face_swapper",
) ... "Tool that puts the face shown on the first image on the second image. You can give it paths to images.",
image = image_generator("Generate an image of a cool surfer in Tahiti") ... )
``` >>> image = face_swapper('./aymeric.jpeg', './ruth.jpg')
```
face_swapper = Tool.from_space(
"tuan2308/face-swap",
"face_swapper",
"Tool that puts the face shown on the first image on the second image. You can give it paths to images.",
)
image = face_swapper('./aymeric.jpeg', './ruth.jpg')
``` ```
""" """
from gradio_client import Client, handle_file from gradio_client import Client, handle_file