mirror of
https://github.com/nod-ai/AMD-SHARK-Studio.git
synced 2026-04-03 03:00:17 -04:00
Fix MacOS web execution flow (#1899)
* fix metal device path for chatbot * single device remove indexing * lint fix
This commit is contained in:
committed by
GitHub
parent
2754e2e257
commit
db89b1bdc1
@@ -153,6 +153,7 @@ def chat(
|
||||
|
||||
device_id = None
|
||||
model_name, model_path = list(map(str.strip, model.split("=>")))
|
||||
device = device if "=>" not in device else device.split("=>")[1].strip()
|
||||
if "cuda" in device:
|
||||
device = "cuda"
|
||||
elif "sync" in device:
|
||||
@@ -164,6 +165,8 @@ def chat(
|
||||
device = "vulkan"
|
||||
elif "rocm" in device:
|
||||
device = "rocm"
|
||||
elif "metal" in device:
|
||||
device = "metal"
|
||||
else:
|
||||
print("unrecognized device")
|
||||
|
||||
@@ -331,6 +334,8 @@ def llm_chat_api(InputData: dict):
|
||||
elif "vulkan" in device:
|
||||
device_id = int(device.split("://")[1])
|
||||
device = "vulkan"
|
||||
elif "metal" in device:
|
||||
device = "metal"
|
||||
else:
|
||||
print("unrecognized device")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user