Compare commits

...

15 Commits

Author SHA1 Message Date
Ean Garvey
859624e0c0 Merge branch 'main' into llm-rest-api 2024-04-19 11:11:51 -05:00
Ean Garvey
32557ab1a2 Merge branch 'main' into llm-rest-api 2024-02-19 10:28:26 -06:00
Ean Garvey
b983cb31f7 Merge branch 'main' into llm-rest-api 2024-02-12 11:31:08 -06:00
Ean Garvey
1dba5dd012 Merge branch 'main' into llm-rest-api 2024-02-07 09:52:23 -06:00
Ean Garvey
f009c8b6d5 Remove unused import. 2024-02-05 11:49:29 -06:00
Ean Garvey
198c42c61c Formatting and init files. 2024-02-05 11:21:30 -06:00
Ean Garvey
c4f3526e71 Merge branch 'main' into llm-rest-api 2024-02-05 11:19:44 -06:00
Ean Garvey
83a1446d7e Add rest API endpoint from LanguageModel API 2024-02-02 23:24:27 -06:00
Stanley Winata
934c35287c HF-Reference LLM mode + Update test result to match latest Turbine. (#2080)
* HF-Reference LLM mode.

* Fixup test to match current output from Turbine.

* lint

* Fix test error message + Only initialize HF torch model when used.

* Remove redundant format_out change.
2024-02-02 11:33:31 -06:00
Ean Garvey
2935166e6d Add StreamingLLM support to studio2 chat (#2060)
* Streaming LLM

* Update precision and add gpu support

* (studio2) Separate weights generation for quantization support

* Adapt prompt changes to studio flow

* Remove outdated flag from llm compile flags.

* (studio2) use turbine vmfbRunner

* tweaks to prompts

* Update CPU path and llm api test.

* Change device in test to cpu.

* Fixes to runner, device names, vmfb mgmt

* Use small test without external weights.
2024-02-02 11:33:28 -06:00
Ean Garvey
019ba7051d Small cleanup 2024-02-02 11:25:41 -06:00
Ean Garvey
a43c5590d5 Add test for SD 2024-01-17 12:21:28 -06:00
Stefan Kapusniak
7a0017df33 Studio2: Remove duplications from api/utils.py (#2035)
* Remove duplicate os import
* Remove duplicate parse_seed_input function

Migrating to JSON requests in SD UI

More UI and app flow improvements, logging, shared device cache

Model loading

Complete SD pipeline.

Tweaks to VAE, pipeline states

Pipeline tweaks, add cmd_opts parsing to sd api
2024-01-17 12:14:39 -06:00
Stefan Kapusniak
cdf2eb51d7 Studio2/SD: Use more correct LoRA alpha calculation (#2034)
* Updates ProcessLoRA to use both embedded LoRA alpha, and lora_strength
optional parameter (default 1.0) when applying LoRA weights.
* Updates ProcessLoRA to cover more dim cases.
* This bring ProcessLoRA into line with PR #2015 against Studio1
2024-01-17 12:14:38 -06:00
Ean Garvey
dbacc36a92 (WIP): Studio2 app infra and SD API
UI/app structure and utility implementation.

- Initializers for webui/API launch
- Schedulers file for SD scheduling utilities
- Additions to API-level utilities
- Added embeddings module for LoRA, Lycoris, yada yada
- Added image_processing module for resamplers, resize tools,
  transforms, and any image annotation (PNG metadata)
- shared_cmd_opts module -- sorry, this is stable_args.py. It lives on.
  We still want to have some global control over the app exclusively
  from the command-line. At least we will be free from shark_args.
- Moving around some utility pieces.
- Try to make api+webui concurrency possible in index.py
- SD UI -- this is just img2imgUI but hopefully a little better.
- UI utilities for your nod logos and your gradio temps.

Enable UI / bugfixes / tweaks
2024-01-17 12:14:36 -06:00
5 changed files with 21 additions and 22 deletions

View File

@@ -27,6 +27,25 @@ from apps.shark_studio.web.utils.file_utils import get_resource_path
# for i in shark_sd_fn_dict_input(sd_kwargs):
# print(i)
from apps.shark_studio.api.llm import LanguageModel, llm_chat_api
from apps.shark_studio.api.sd import shark_sd_fn_dict_input, view_json_file
from apps.shark_studio.web.utils.file_utils import get_resource_path
# class SDAPITest(unittest.TestCase):
# def testSDSimple(self):
# from apps.shark_studio.modules.shared_cmd_opts import cmd_opts
# import apps.shark_studio.web.utils.globals as global_obj
# global_obj._init()
# sd_json = view_json_file(get_resource_path("../configs/default_sd_config.json"))
# sd_kwargs = json.loads(sd_json)
# for arg in vars(cmd_opts):
# if arg in sd_kwargs:
# sd_kwargs[arg] = getattr(cmd_opts, arg)
# for i in shark_sd_fn_dict_input(sd_kwargs):
# print(i)
class LLMAPITest(unittest.TestCase):
def test01_LLMSmall(self):

View File

@@ -25,4 +25,4 @@
"resample_type": "Nearest Neighbor",
"controlnets": {},
"embeddings": {}
}
}

View File

@@ -89,12 +89,6 @@ def webui():
# required to do multiprocessing in a pyinstaller freeze
freeze_support()
# if args.api or "api" in args.ui.split(","):
# from apps.shark_studio.api.llm import (
# chat,
# )
# from apps.shark_studio.web.api import sdapi
#
# from fastapi import FastAPI, APIRouter
# from fastapi.middleware.cors import CORSMiddleware

View File

@@ -13,11 +13,6 @@ import apps.shark_studio.web.utils.globals as global_obj
B_SYS, E_SYS = "<s>", "</s>"
B_SYS, E_SYS = "<s>", "</s>"
B_SYS, E_SYS = "<s>", "</s>"
def user(message, history):
# Append the user's message to the conversation history
return "", history + [[message, ""]]

View File

@@ -125,15 +125,6 @@ body {
}
}
/* media rules in custom css are don't appear to be applied in
gradio versions > 4.7, so we have to define a class which
we will manually need add and remove using javascript.
Remove this once this fixed in gradio.
*/
.gradio-container-size-full {
max-width: var(--size-full) !important;
}
.gradio-container .contain {
padding: 0 var(--size-4) !important;
}
@@ -370,4 +361,4 @@ footer {
top: 14px;
right: 0px;
height: 36px;
}
}