mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Set default model in HuggingFaceMedia
Improve handling of shared chats Show api_key input if required
This commit is contained in:
parent
6767000604
commit
ce500f0d49
18 changed files with 206 additions and 111 deletions
19
etc/examples/video.py
Normal file
19
etc/examples/video.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import g4f.Provider
|
||||
from g4f.client import Client
|
||||
|
||||
client = Client(
|
||||
provider=g4f.Provider.HuggingFaceMedia,
|
||||
api_key="hf_***" # Your API key here
|
||||
)
|
||||
|
||||
video_models = client.models.get_video()
|
||||
|
||||
print(video_models)
|
||||
|
||||
result = client.media.generate(
|
||||
model=video_models[0],
|
||||
prompt="G4F AI technology is the best in the world.",
|
||||
response_format="url"
|
||||
)
|
||||
|
||||
print(result.data[0].url)
|
||||
Loading…
Add table
Add a link
Reference in a new issue