Spaces:
Sleeping
Sleeping
File size: 767 Bytes
276796f d09fd1e 276796f d09fd1e 276796f 4dba2c2 d09fd1e 4dba2c2 d09fd1e 4dba2c2 d09fd1e 276796f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
from gradio_client import Client
import os
client = Client("http://127.0.0.1:7860/")
from dotenv import load_dotenv
load_dotenv()
key = os.getenv("OPENAI_API_KEY")
if not key:
print("OpenAI API key not found. Please set the OPENAI_API_KEY environment variable.")
exit(1)
print(f"Using OpenAI API key: {key}")
result = client.predict(
url="https://www.infoq.com/articles/ai-ml-data-engineering-trends-2024/",
# use_default_template="summary",
# use_default_template=True,
openai_api_key=key,
text_model="gpt-4o-mini",
audio_model="tts-1",
speaker_1_voice="alloy",
speaker_2_voice="echo",
api_base=None,
edited_transcript="",
user_feedback="",
api_name="/generate_audio"
,original_text="summary"
)
print(result) |