Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted concatenation to f-strings #234

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hugginggpt/server/run_gradio_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ def add_text(messages, message):

for image_url in image_urls:
if not image_url.startswith("http"):
image_url = "public/" + image_url
image_url = f"public/{image_url}"
image = load_image(image_url)
name = f"public/images/{str(uuid.uuid4())[:4]}.jpg"
image.save(name)
messages = messages + [((f"{name}",), None)]
for audio_url in audio_urls:
if not audio_url.startswith("http"):
audio_url = "public/" + audio_url
audio_url = f"public/{audio_url}"
ext = audio_url.split(".")[-1]
name = f"public/audios/{str(uuid.uuid4()[:4])}.{ext}"
response = requests.get(audio_url)
Expand All @@ -63,7 +63,7 @@ def add_text(messages, message):
messages = messages + [((f"{name}",), None)]
for video_url in video_urls:
if not video_url.startswith("http"):
video_url = "public/" + video_url
video_url = f"public/{video_url}"
ext = video_url.split(".")[-1]
name = f"public/audios/{str(uuid.uuid4()[:4])}.{ext}"
response = requests.get(video_url)
Expand Down