Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
oobabooga committed Nov 18, 2024
2 parents 3d19746 + 1c937da commit d012938
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 17 deletions.
15 changes: 7 additions & 8 deletions extensions/openai/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,21 +143,20 @@ def convert_history(history):
new_history = []
for entry in history:
if isinstance(entry['content'], list):
image_url = None
content = None
for item in entry['content']:
if not isinstance(item, dict):
continue


image_url = None
content = None
if item['type'] == 'image_url' and isinstance(item['image_url'], dict):
image_url = item['image_url']['url']
elif item['type'] == 'text' and isinstance(item['text'], str):
content = item['text']

if image_url:
new_history.append({"image_url": image_url, "role": "user"})
if content:
new_history.append({"content": content, "role": "user"})
if image_url:
new_history.append({"image_url": image_url, "role": "user"})
if content:
new_history.append({"content": content, "role": "user"})
else:
new_history.append(entry)

Expand Down
2 changes: 2 additions & 0 deletions modules/ui_model_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ def download_model_wrapper(repo_id, specific_file, progress=gr.Progress(), retur
yield ("Please enter a model path")
return

repo_id = repo_id.strip()
specific_file = specific_file.strip()
downloader = importlib.import_module("download-model").ModelDownloader()

progress(0.0)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate==1.0.*
accelerate==1.1.*
bitsandbytes==0.44.*
colorama
datasets
Expand Down
2 changes: 1 addition & 1 deletion requirements_amd.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate==1.0.*
accelerate==1.1.*
colorama
datasets
einops
Expand Down
2 changes: 1 addition & 1 deletion requirements_amd_noavx2.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate==1.0.*
accelerate==1.1.*
colorama
datasets
einops
Expand Down
2 changes: 1 addition & 1 deletion requirements_apple_intel.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate==1.0.*
accelerate==1.1.*
colorama
datasets
einops
Expand Down
2 changes: 1 addition & 1 deletion requirements_apple_silicon.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate==1.0.*
accelerate==1.1.*
colorama
datasets
einops
Expand Down
2 changes: 1 addition & 1 deletion requirements_cpu_only.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate==1.0.*
accelerate==1.1.*
colorama
datasets
einops
Expand Down
2 changes: 1 addition & 1 deletion requirements_cpu_only_noavx2.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate==1.0.*
accelerate==1.1.*
colorama
datasets
einops
Expand Down
2 changes: 1 addition & 1 deletion requirements_noavx2.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate==1.0.*
accelerate==1.1.*
bitsandbytes==0.44.*
colorama
datasets
Expand Down
2 changes: 1 addition & 1 deletion requirements_nowheels.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate==1.0.*
accelerate==1.1.*
colorama
datasets
einops
Expand Down

0 comments on commit d012938

Please sign in to comment.